Repository navigation
perf(proxy): avoid joining signing paths and queries - #304
Open
perfloop[bot] wants to merge 2 commits into
Open
perfloop[bot] wants to merge 2 commits into
perfloop[bot] wants to merge 2 commits into
Conversation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
[Medium impact] The PR appears safe to merge. SummaryThe PR avoids joining the decoded path and raw query before signing.
No actionable issues were found. Tests were inspected, not run during this review. Reviews (1) · Last reviewed commit: "perf(proxy): avoid joining signing path ..." · Reviewed by Greptile |
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.
Pass the decoded path and raw query separately to the signer instead of joining and immediately splitting them.
SignRequestkeeps its combined-target contract. Paths containing a literal?retain the existing join-and-split fallback; URL escaping, raw-fragment handling, body setup, and signing still use the common implementation.The existing benchmark in
proxy/forwarder_signing_benchmark_test.gonow covers empty, short, and longer list queries alongside its tagging request.Measurements
Local paired benchmark measurements used matched Go 1.27.2 builds and
GOMAXPROCS=4. They cover the complete signing passthrough path, including validation and response forwarding. A controlled transport returns an empty HTTP 200 response, excluding upstream network time. The continuation tokens are constructed inputs, not sampled production queries. Warmup invocations are excluded.Each metric cell shows the before and after medians, followed by the median paired decrease in the same units. Each row is a separate experiment:
Allocated bytes improved for both longer-token workloads. All elapsed-time and allocation-count guards, and the empty/short-query byte guards, met their 5% no-regression bounds. The empty-query byte median was slightly higher; this is not a claim of zero overhead or a demonstrated elapsed-time speedup. Production query mix and end-to-end latency remain unmeasured.
Measurements selected each row separately in precompiled native Go test binaries:
Native benchmark reproduction:
Validation
The Go auth/proxy unit tests, focused signing race tests, and routed signing-handler checks passed. The new target test checks query separators, escaping, raw fragments, and the literal-question-mark fallback. Existing signer tests cover context, body setup, endpoint errors, and legacy signature equivalence. The handler checks cover independent upstream signature validation and complete versus truncated response delivery.
S3 compatibility tests (tiered): unresolved in target CI. This change does not claim to repair that failure.
Related work: #200 changes presigned forwarding; this removes target assembly in the existing header-signing builder.
Case and evidence
Made by Perfloop. To ask for a change, comment or review in plain words. How Perfloop handles pull requests.