Repository navigation
perf: separate-process benchmark and leaner receipt sealing - #53
Merged
Merged
Conversation
Measure scheduled arrivals outside the gateway CPU budget. Add opt-in receipt trace regions without changing commit acknowledgment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Keep transport queueing in scheduled latency. Limit client connections to avoid loopback accept bursts. Preserve failed-case evidence and correlate request tails with receipt trace phases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Capture GC counters outside the request timer. Stop tracing before writing profiles and skip stack lines during trace analysis. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Validate preflight drafts without building an unused preimage. Size the signed preimage from validated fields instead of maximum field sizes. Keep canonical bytes and synchronous commit acknowledgment unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Correlate receipt phases with the same tail requests. Record client acquisition separately and profile upstream reuse. Add macOS foreground-policy controls and analyzer regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Keep the failed gate explicit, including the 1.7-second transport tail. Record correlated receipt, GC, lock, and connection evidence. Qualify shared-host variance and pending Linux validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Exclude failed samples from latency statistics and suppress p99 on invalid rows. Keep successful-only diagnostic percentiles and test partial and total failures. Attribute p99 movement to host noise and clarify production trace instrumentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
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.
Plan
Follow-up to #50: investigate the gateway's p99 overhead with a better method, and fix only what is safe. Receipt durability and all security checks are unchanged.
Gate status: still not met at any fixed-rate load on this host. This PR improves the method, removes one avoidable cost, and records where the tail goes.
What changed
make bench-proc). The gateway, mock upstream and open-loop load generator run as 3 processes, so the generator no longer competes with the gateway's 4 Ps.p99: null).d15cf71, allocation fix on the receipt path. It drops a redundant 3 KB preflight buffer and right-sizes the seal preimage. That saves about 6.2 KB per request, a 24.2% allocation reduction. Receipt bytes, hashes and signatures are unchanged; golden vectors and chain tests pass.8632eb0, trace regions inledger.go. These are production code, but they do nothing when tracing is off.bench/RESULTS.md. Separate-process numbers, a tail breakdown, and a verdict per load level.What the data says
COMMITis about 13%. Other stalls are transport-side, including one 1.7s outlier.d15cf71(50.7, then 2.73, then 8.19 ms at 5K/s). Two "before" runs of the same case already differed 2.5x.COMMITcost, without weakening sync-before-response.Validation
go build ./...: passedgo vet ./...: passedgo test -race ./... -count=2: passedsemgrep --config auto --error --quiet ./internal ./cmd ./pkg: passedReview
Reviewed by a second model (Claude Opus 5.5). Approved. It confirmed:
Its 3 minor notes (caveats in RESULTS.md, attribution of the trace commit, failed samples) are fixed here.