perf(Signal): speed up multicast dispatch; chore: normalise line endings to LF#17
Merged
Merged
Conversation
The repo forced eol=crlf on checkout while storing LF blobs; *.sh was even marked eol=crlf, which corrupts shell scripts. Switch to plain text=auto so working trees check out LF on every platform. All blobs were already LF, so git add --renormalize touched nothing but .gitattributes.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17 +/- ##
==========================================
+ Coverage 91.53% 91.56% +0.02%
==========================================
Files 398 399 +1
Lines 15481 15546 +65
Branches 2231 2248 +17
==========================================
+ Hits 14171 14235 +64
+ Misses 990 989 -1
- Partials 320 322 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.



Two independent changes (squash-merge will keep them as one; the commits are atomic if you prefer rebase):
perf(Signal): typed observer/action fields for multicast dispatch
Signal<T>.SignalSubscriptionstored its target in a singleobject _targetand, on every dispatched callback, did anis Action<T>type-test plus an(IObserver<T>)_targetcast. On the multicast hot path (DispatchSubscriptions) that isinst+castclass runs once per observer per value.This switches the subscription to two typed fields —
IObserver<T>? _observerandAction<T>? _action— so dispatch branches on a cheap null check.OnError/OnCompletedcollapse to_observer?.On…(…). The single-observer/single-action fast paths are unchanged.Results
ShortRun, net10.0, 1024 emits fanned out to N observers (new
SubjectMulticastBenchmarks):Signal<T>goes from ~24–28% behindSystem.Reactive.Subject<T>to ~6–9%, stays well ahead of R3, and keeps the lowest allocation of the three. Cost is +8 bytes perSignalSubscription(one extra reference field).All 221
ReactiveUI.Primitives.Testspass (net9.0); behaviour preserved (action subscriptions still ignoreOnError/OnCompleted, now via the null_observer).chore: normalise line endings to LF
.gitattributesforcedeol=crlfon checkout while storing LF blobs, and even marked*.sh eol=crlf(which corrupts shell scripts). Switched the global rule to plain* text=autoand dropped the forcedeol=crlffrom*.sln,*.sh,*.cmd,*.bat, so working trees check out LF on every platform.git add --renormalize .confirmed every blob was already LF, so the only committed change is.gitattributesitself.