Add benchmarks and Signal fast-path improvements#2
Merged
Conversation
Add a new benchmark project and many benchmark scenarios (BenchmarkDotNet artifacts, README metrics and run instructions). Refactor Signal<T> to introduce a SpinLock-based observer lock and add a separate single-observer fast-path (_singleObserverSubscription) alongside the existing single-action fast-path. Optimize OnNext to fast-return for the single-observer case, update subscribe/remove/dispose paths to handle dual fast-paths safely (PromoteSingleObserverLocked, RemoveSingleSubscriptionLocked, RemoveArraySubscriptionLocked, lock Enter/Exit usage), and adjust completion/error dispatch to include the single-observer. Add many operator parity helper implementations (AggregateHelpers, Helpers, SelectMany) and update related signal/operator files and tests to align with the changes.
Introduce FromEnumerableSignal<T> as an inline, finite-signal implementation and return it from Signal.FromEnumerable (replacing the previous CreateSafe closure). Add a BenchmarkDotNet benchmark (FactoryFromEnumerableBenchmarks) and wire it into the benchmarks Program; update README paths and benchmark notes to reference the new benchmarks and the focused FromEnumerable row. Refactor SignalFromTaskTest to use a thread-safe StatusTrail, add WaitForAsync and a cancellation timeout constant, remove an unused using, and centralize status recording helpers to improve reliability of cancellation tests. Add a GitHub Actions step to validate SONAR_TOKEN and skip SonarCloud analysis when not configured. Remove the temporary R3 probe project files.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2 +/- ##
==========================================
- Coverage 82.84% 81.58% -1.26%
==========================================
Files 21 21
Lines 239 239
Branches 47 47
==========================================
- Hits 198 195 -3
- Misses 32 34 +2
- Partials 9 10 +1 ☔ 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.


Add a new benchmark project and many benchmark scenarios (BenchmarkDotNet artifacts, README metrics and run instructions). Refactor Signal to introduce a SpinLock-based observer lock and add a separate single-observer fast-path (_singleObserverSubscription) alongside the existing single-action fast-path.
Optimize OnNext to fast-return for the single-observer case, update subscribe/remove/dispose paths to handle dual fast-paths safely (PromoteSingleObserverLocked, RemoveSingleSubscriptionLocked, RemoveArraySubscriptionLocked, lock Enter/Exit usage), and adjust completion/error dispatch to include the single-observer.
Add many operator parity helper implementations (AggregateHelpers, Helpers, SelectMany) and update related signal/operator files and tests to align with the changes.