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

Make WeakReferenceMessenger broadcasting 0-alloc! #40

Closed
5 tasks done
Sergio0694 opened this issue Nov 15, 2021 · 0 comments · Fixed by #44
Closed
5 tasks done

Make WeakReferenceMessenger broadcasting 0-alloc! #40

Sergio0694 opened this issue Nov 15, 2021 · 0 comments · Fixed by #44
Assignees
Labels
mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit optimization ☄ Performance or memory usage improvements

Comments

@Sergio0694
Copy link
Member

Sergio0694 commented Nov 15, 2021

Needs #34 first, as we'll be using DependentHandle.
There are a number of performance/memory usage optimizations I have planned for WeakReferenceMessenger:

  • Leverage DependentHandle and a custom table to achieve 0-alloc enumeration
  • Investigate lock-free improvements as we know callers are synchronized
  • Investigate refactor detailed in [API Proposal]: RuntimeHelpers.ChangeType<TDelegate>(Delegate) API dotnet/runtime#57495 (comment) to remove the Unsafe.As<T> usage to alias delegate types and also improve performance when invoking callbacks (by adding a fast path with explicit guarded devirtualization when invoking callbacks mapping to IRecipient<TMessage> directly, as opposed to having an additional delegate stub with closure).
  • Bring over new performance improvements to Dictionary<TKey, TValue> to the DictionarySlim<TKey, TValue> fork
  • Investigate reintroducing hashcode caching for better lookup performance when broadcasting
@Sergio0694 Sergio0694 added optimization ☄ Performance or memory usage improvements mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit labels Nov 15, 2021
@Sergio0694 Sergio0694 self-assigned this Nov 15, 2021
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 a pull request may close this issue.

1 participant