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

Reduce allocs in AggregateBindable #6198

Merged
merged 4 commits into from Feb 26, 2024

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Feb 26, 2024

The benchmarks are below, but only the 2nd result is the significant one to me because it removes a WeakReference alloc. It's still not zero, though, and the other alloc is very hard/impossible to remove with the current structure of things.

Master:

Method Mean Error StdDev Gen0 Allocated
AddRemoveSource 2.111 us 0.0413 us 0.0776 us 0.2098 1.72 KB
SetValue 20.122 us 0.2580 us 0.2413 us 0.5493 4.69 KB

Without allocating weak references:

Method Mean Error StdDev Gen0 Allocated
AddRemoveSource 1.760 us 0.0352 us 0.0481 us 0.2041 1.67 KB
SetValue 18.815 us 0.3394 us 0.2834 us 0.5493 4.69 KB

Struct:

Method Mean Error StdDev Gen0 Allocated
AddRemoveSource 1.580 us 0.0169 us 0.0141 us 0.1411 1.16 KB
SetValue 18.746 us 0.0980 us 0.0917 us 0.5493 4.69 KB

@peppy peppy self-requested a review February 26, 2024 12:45
Copy link
Sponsor Member

@peppy peppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍

@peppy peppy enabled auto-merge February 26, 2024 12:49
@peppy peppy merged commit 051c483 into ppy:master Feb 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants