Repository navigation
Add AOT-first ProMvvm WhenAnyValue parity through arity 12 - #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build the first production-ready ProMvvm
WhenAnyValueslice: a .NET 10-first, dependency-free property-observation runtime with AOT-safe typed APIs and a ReactiveUI-compatible migration surface.Item[]/custom indexer notification names, nested rewiring, array-length support, and matching captured/array error behavior.ReactiveUIcore andReactiveUI.Reactive24.0.0 separately.Design and compatibility
The runtime package has no ReactiveUI, CommunityToolkit.Mvvm, or System.Reactive dependency. Typed getters and generated/reusable
PropertyPathdescriptors use normal closed generic code, delegates, and notification subscriptions, so they remain trim-safe and NativeAOT-safe. Expression and runtime string-name overloads are explicitly markedRequiresUnreferencedCodefor migration use.Direct indexers with
int,string, and(int,int)arguments bind typed delegates. Other constant signatures use .NET 10MethodInvoker, with fixed-argument calls through arity four and a span fallback above that. A value-type structural cache key preserves constant value/type or object-identity semantics, and the atomic last-entry path compares constants before allocating copied arguments.Two- and three-link expressions reuse compact subscription engines; four-or-more-link paths use the general watcher graph. All variants retain synchronous initial delivery, nested suffix rewiring, null rules, deterministic disposal, serialized notifications, and error termination.
Performance
BenchmarkDotNet 0.15.8, .NET 10.0.5, Apple M3 Pro; ReactiveUI and ReactiveUI.Reactive 24.0.0. Each result is mean time / managed allocation.
Structural pre-allocation lookup plus typed indexer delegates reduced direct expression hot start from 281.131 ns / 976 B to 257.366 ns / 888 B and emission from 17.843 ns / 48 B to 11.416 ns / 24 B. The isolated getter benchmark measured
PropertyInfo.GetValueat 9.371 ns / 24 B, cached-argumentMethodInvokerat 5.845 ns / 24 B, and a bound delegate at 0.257 ns / 0 B.The full matrix and measurement rules are in
benchmarks/README.md.Validation
Latest commit structure
8a18e6f— match ReactiveUI multi-selector semantics297f61f— optimize constant-indexer expression paths and cover their behaviorebe7b3b— validate both ReactiveUI 24 distributions2ea172b— add the direct/nested indexer benchmark matrix51993f8— document the architecture, compatibility, and results9af9789— normalize generator source assertions across LF and CRLF platforms