Skip to content

Conversation

@MarchingCube
Copy link
Contributor

What does the pull request do?

Another case of C# syntax sugar causing extra allocations. Found this when checking #3292 and wondering what do we actually allocate there.

What is the current behavior?

We allocate up to 128 bytes of delegates per Control. 64 bytes in Visual is always allocated, 64 bytes in StyledElement when we access logical children for the first time (quite common as well, but not always).

What is the updated/expected behavior with this PR?

Both delegates are cached by the compiler automatically.

How was the solution implemented (if it's not obvious)?

Checklist

@MarchingCube MarchingCube requested a review from grokys November 26, 2019 21:44
@grokys grokys merged commit b99131a into AvaloniaUI:master Nov 29, 2019
@MarchingCube MarchingCube deleted the alloc-children-changed branch November 29, 2019 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants