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

Optimize WeakReferenceMessenger #44

Merged
merged 21 commits into from
Dec 10, 2021
Merged

Optimize WeakReferenceMessenger #44

merged 21 commits into from
Dec 10, 2021

Conversation

Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented Nov 29, 2021

Closes #40

This PR includes the following changes:

Benchmarks

Info Mean Error StdDev Gen 0 Allocated
main 17.41 ms 0.2930 ms 0.2600 ms 31.2500 188 KB
ConditionalWeakTable2 fork (dabca2a) 17.84 ms 0.0820 ms 0.0690 ms 31.2500 188 KB
ref struct enumerator (9b86a88) 15.32 ms 0.0730 ms 0.0570 ms - -
No active enumerators tracking (b1dc97b) 15.25 ms 0.0260 ms 0.0200 ms - -
Monitor.Enter loop hoisting (e92c5c2) 11.33 ms 0.2090 ms 0.1960 ms - -
Dictionary2 fork (9be01fa) 11.52 ms 0.0370 ms 0.0290 ms - -
typeof(Unit) specialization (fc538c3) 9.839 ms 0.1863 ms 0.1743 ms - -
Remove Unsafe.As(object) (9dd8ea9) 9.830 ms 0.1930 ms 0.1982 ms - -
No bounds checks, strength reduction (4408379) 9.309 ms 0.1709 ms 0.1515 ms - -
Remove KeyValuePair<,> usage 7.980 ms 0.1586 ms 0.2006 ms - -
Reduce enumerator field accesses (3f20dce) 7.348 ms 0.1494 ms 0.1834 ms - -
Remove array covariance checks (15bd652) 7.246 ms 0.1056 ms 0.0988 ms - -

@Sergio0694 Sergio0694 added optimization ☄ Performance or memory usage improvements mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit labels Nov 29, 2021
@Sergio0694 Sergio0694 marked this pull request as ready for review November 29, 2021 13:38
@Sergio0694 Sergio0694 merged commit 32a27ee into main Dec 10, 2021
@delete-merged-branch delete-merged-branch bot deleted the dev/weak-messenger-opts branch December 10, 2021 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit optimization ☄ Performance or memory usage improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make WeakReferenceMessenger broadcasting 0-alloc!
3 participants