perf(runtime): reduce timed RPC emission overhead and restore batching - #677
Merged
Merged
Conversation
Bumps TUnit from 1.63.0 to 1.64.6 --- updated-dependencies: - dependency-name: TUnit dependency-version: 1.64.6 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: testing ... Signed-off-by: dependabot[bot] <support@github.com>
…bf2f9 Bump the testing group with 1 update
Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.37.4 to 4.37.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@f205ea1...5595cca) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…ub/codeql-action/init-4.37.6 Bump github/codeql-action from 4.37.4 to 4.37.6
Bumps Microsoft.Extensions.DependencyInjection from 10.0.10 to 10.0.11 Bumps Microsoft.Extensions.DependencyInjection.Abstractions from 10.0.10 to 10.0.11 Bumps Microsoft.Extensions.Diagnostics.HealthChecks from 10.0.10 to 10.0.11 Bumps Microsoft.Extensions.Hosting from 10.0.10 to 10.0.11 Bumps Microsoft.Extensions.Logging to 10.0.11 Bumps Microsoft.Extensions.Logging.Abstractions from 10.0.10 to 10.0.11 Bumps Microsoft.Extensions.Logging.Console from 10.0.10 to 10.0.11 --- updated-dependencies: - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.Diagnostics.HealthChecks dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.Hosting dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.Logging dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.Logging dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-major dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.Logging.Abstractions dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions - dependency-name: Microsoft.Extensions.Logging.Console dependency-version: 10.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft-extensions ... Signed-off-by: dependabot[bot] <support@github.com>
…e/microsoft-extensions-9b6f1c2dce Bump Microsoft.Extensions.DependencyInjection and 6 others
chore: release 1.1.2
Bumps TUnit from 1.64.6 to 1.65.68 --- updated-dependencies: - dependency-name: TUnit dependency-version: 1.65.68 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: testing ... Signed-off-by: dependabot[bot] <support@github.com>
…cc221a Bump the testing group with 1 update
Bumps [github/codeql-action/analyze](https://github.com/github/codeql-action) from 4.37.6 to 4.37.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@5595cca...cdf488f) --- updated-dependencies: - dependency-name: github/codeql-action/analyze dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…hub/codeql-action/analyze-4.37.9 chore(deps): bump github/codeql-action/analyze from 4.37.6 to 4.37.9
Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.37.6 to 4.37.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@5595cca...cdf488f) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…hub/codeql-action/init-4.37.9 chore(deps): bump github/codeql-action/init from 4.37.6 to 4.37.9
…febc3 Bump Microsoft.CodeAnalysis.CSharp from 5.6.0 to 5.9.0
Bumps Microsoft.CodeAnalysis.Analyzers from 5.6.0 to 5.9.0 Bumps Microsoft.CodeAnalysis.CSharp from 5.0.0 to 5.9.0 --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.Analyzers dependency-version: 5.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: roslyn - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-version: 5.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: roslyn ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps TUnit from 1.65.68 to 1.66.16 --- updated-dependencies: - dependency-name: TUnit dependency-version: 1.66.16 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: testing ... Signed-off-by: dependabot[bot] <support@github.com>
Introduce independent local lifecycle, readiness, and cluster state domains for single- and multi-cluster clients. Start hosted clients without blocking on remote availability, supervise initial connectivity recovery, preserve legacy explicit connection semantics, keep runtime Add/Replace candidates in the new child lifecycle, and prevent compatibility connection failures from tearing down an already-running coordinator. Fixes #644
…adiness Decouple client lifecycle from remote readiness
Replace public RunAsync with explicit StartAsync, WaitForShutdownAsync, and StopAsync ownership. Move accept/runtime supervision into SharpLinkServer, keep per-connection cleanup failures local including heartbeat-timeout cleanup, simplify Generic Host lifetime bridging, migrate repository callers, and document terminal failure semantics. Fixes #646
Split server start/wait/stop lifecycle
…26-09-10 Revert accidental main merges from 2026-09-10
…e3670 Bump the roslyn group with 2 updates
…165df4 Bump the testing group with 1 update
Release SharpLink 2.0.0: merge dev into main
release: finalize SharpLink 2.0.0 on main
SunSi12138
marked this pull request as ready for review
September 12, 2026 23:12
This was referenced Sep 13, 2026
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.
Timed Unary requests currently create and supervise a send-completion task for every request. They also force a transport flush per timed frame, even when more requests are already queued. The release ABA against published 1.1.1 exposed higher client allocation and lower high-concurrency throughput on main
b3078000d80a7400373ea5ae67a1e3ffd8e5dbcc.The existing send pump now reports queued request failures directly to the pending-call table. It captures the request ID before returning the buffer and invokes the failure owner outside the admission lock. Successful Unary calls still complete only on their response; a request that expires at emission still completes with DeadlineExceeded without requiring a timer callback. Pooled frames retain the observer in their existing completion-state reference.
Ready timed requests can also share one bounded publication batch. The pump acquires one output span, copies the complete retained suffix, then samples the monotonic clock once. It removes expired requests, compacts surviving frames in order, stamps their remaining budgets, and starts FlushAsync before expired-request callbacks or telemetry. A timed batch never waits for new arrivals or the configured batch timer; existing size thresholds, LowLatency flushes, and the 64-frame progress interleave remain enforced.
Validation:
TimedUnaryShouldObserveEmissionWithinTheSendPumpLifetimefails on unchanged b307800 production code and passes with the correction.TimedUnaryDroppedAtEmissionShouldCompleteWithoutDeadlineTimerCallbackremains passing.QueuedTimedRequestsShouldSharePublicationAndDropExpiredFrames: all five original cases fail against pre-batching 6a22b42 production code; all pass with batching restored. The final cases additionally retain an untimed frame inside the compacted suffix.Final BenchmarkDotNet comparison of b307800 versus 0141a85: 64 concurrent Add RPCs per burst, reported per RPC; 8192 bursts per iteration, six warmups, 12 measured iterations, outliers retained, DOTNET_PROCESSOR_COUNT=8, the same Apple M4/.NET 10.0.11/Server GC environment. Timed mean is 5.723 ± 0.1113 us before versus 1.860 ± 0.0364 us after (99.9% confidence half-widths); allocation is 1118 versus 452 B/RPC, completed work items 3.5644 versus 1.3167. Untimed control is 1.729 ± 0.0355 versus 1.726 ± 0.0228 us, with 284 B/RPC in both. Measured lock-contention counters round to zero in all four cases.
The separate four-core server + VM/Mac diagnostic compares 6a22b42 to 0141a85, with a fresh server per case/phase. High-concurrency Add: A1 231974, B 285698, A2 218950 completed/s; B server CPU 2.48 cores versus A approximately 3.66. High Echo(256): 148190 / 164251 / 152175 completed/s, with B p99 2095 us versus A 2347/2353 us. Add p99 was higher (2895 versus 1179/998 us) and A drift was 5.6%; final-main validation must review those explicitly.
These results validate the two focused corrections. Release publication remains blocked on final-main validation and the separate low-concurrency OneWay/upload investigation against published 1.1.1. The release tag has not been created. Final performance validation will use the resulting exact main commit and its gated packages.