Skip to content

Add benchmarks and Signal fast-path improvements#2

Merged
ChrisPulman merged 2 commits into
mainfrom
Optimise
May 25, 2026
Merged

Add benchmarks and Signal fast-path improvements#2
ChrisPulman merged 2 commits into
mainfrom
Optimise

Conversation

@ChrisPulman
Copy link
Copy Markdown
Member

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.

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.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.58%. Comparing base (5a02cca) to head (3595007).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisPulman ChrisPulman merged commit ac8bcfa into main May 25, 2026
12 of 14 checks passed
@ChrisPulman ChrisPulman deleted the Optimise branch May 25, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant