Repository navigation
perf(server): right-size deadline snapshot rentals - #257
Conversation
SunSi12138
left a comment
There was a problem hiding this comment.
Codex review: the lease/retry correctness looks sound on review and PR Quick is green. Remaining concerns are inline; I would keep this draft until the performance evidence and failure-path coverage are addressed.
SunSi12138
left a comment
There was a problem hiding this comment.
Second pass: the opt-in count change addresses the shared-counter concern, and the new failure-path tests cover dispose/re-arm behavior. The performance-evidence P1 remains open; one additional test gap is inline.
SunSi12138
left a comment
There was a problem hiding this comment.
Codex review follow-up: no additional findings on the latest head. Rechecked the opt-in count tracking, bounded snapshot retry/cleanup paths, the strengthened 100k pool-reuse lease test, and the performance evidence. The current dev tip has advanced since the original baseline, but the PR merge commit is generated against current dev and PR Quick #666 / CodeQL #721 are green; the intervening runtime/build changes do not touch these scheduler/map implementation files.
d175f94 to
83508bf
Compare
Fixes #246.
Summary
StripedLongMapoccupancy tracking opt-in so non-deadline users such asStreamManagerdo not pay shared atomic count writesTryCopyEntriespath for snapshot sizing races_maxCallsceilingBaseline
Implemented and measured against
dev@84e5152b00edce43fdf8280af6237fb4ead42839.GitHub-hosted base/head performance evidence
Evidence run: https://github.com/SunSi12138/SharpLink/actions/runs/32389187846
Artifact:
issue246-perf-evidence(artifact id9414197210, retained 14 days).Method: one GitHub-hosted Ubuntu 24.04 VM (
AMD EPYC 7763, .NET SDK10.0.400), base/head built in the same job, measurements pinned to the same logical CPU, five alternating ABBA repetitions. CPU/lateness numbers are comparative hosted-runner evidence rather than bare-metal absolute guarantees.max=1024 active=8max=65536 active=8max=65536 active=128, clusteredmax=65536 active=1024max=65536 active=0Registration/completion map hot-path probe:
Set+TryRemovemedian51.22 ns/opbase →49.26 ns/ophead (-3.82%), with0.00 managed B/opon both. The head count is opt-in to the server deadline-call map; non-deadlineStripedLongMapusers do not enable it.Working-set measurements on the hosted VM were noisier than the deterministic sizing metrics. Peak working set was +0.69% for the default
1024/8case and 2.9–7.4% lower for the measuredmax=65536active cases; no high-max regression signal was observed.The measured head was
cf6ae532779ab18af5e703145c852269f879579e; after collecting the artifact, all temporary benchmark workflows were deleted. The final PR diff contains only the two implementation files and two deadline scheduler test files, so the measured production implementation is unchanged.Validation
Final cleaned head:
83508bf737a78b2457273c4a254e60dd42446a6c.PR Quick #666: success — formatting, Debug/Release build, Unit Tests, Generator Tests, Load Test Tests, Integration Tests, NativeAOT transport/topology smoke, packaging checks, package smoke, demo, Load Smoke, and Chaos Smoke all passed.CodeQL #721: success.32389187846: success; artifact uploaded before all temporary workflow files were removed.src/SharpLink.Runtime/StripedLongMap.cssrc/SharpLink.Server/ServerCallDeadlineScheduler.cstest/SharpLink.UnitTests/Server/ServerCallDeadlineSchedulerFailureTests.cstest/SharpLink.UnitTests/Server/ServerCallDeadlineSchedulerSizingTests.cs