Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache delegates used for reacting to logical and visual children changes #3296

Merged
merged 3 commits into from
Nov 29, 2019

Conversation

MarchingCube
Copy link
Collaborator

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

@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