Skip to content

perf(auth): avoid reparsing signing URLs - #164

Merged
ovaistariq merged 2 commits into
mainfrom
perfloop-pr-open-cwdfpdar3z
Aug 18, 2026
Merged

ovaistariq merged 2 commits into
mainfrom
perfloop-pr-open-cwdfpdar3z

Conversation

@perfloop

@perfloop perfloop Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Change

Cache the normalized signing endpoint URL and copy it for each request instead of serializing and reparsing it. Keep the legacy path for raw # query targets so their fragment semantics remain unchanged.

Add passthrough handler benchmarks for escaped GetObjectTagging and body-bearing UploadPart requests, including a four-worker UploadPart case.

Validation

  • make lint-ci
  • make test-auth
  • make test-proxy
  • go test -race ./auth ./proxy
  • go test -race ./proxy -run '^$' -bench '^BenchmarkServiceHandlePassthroughSigningUploadPartParallel$' -benchtime=100ms -count=1 -cpu=4

Workload: Serial Service.HandlePassthrough signing GetObjectTagging with long escaped key and versionId

Metric Before After Change
ns/op 39605 35979 9.2% lower
B/op 18956 17371 8.4% lower

Workload: Four-worker Service.HandlePassthrough signing UploadPart with body, long escaped key, and upload query

Metric Before After Change
ns/op 21124 19317 8.6% lower
B/op 23366 20868 10.7% lower
Checks: 6 passed.

Generated by Perfloop. Measurements and checks.


Note

Cursor Bugbot is generating a summary for commit b5c237d. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR caches the normalized signing endpoint URL and copies that template for each outgoing signed request, retaining the legacy parse path for raw fragment syntax.

  • Adds URL-field, signature, body, malformed-endpoint, and concurrency compatibility coverage.
  • Adds serial and parallel signing benchmarks for passthrough GetObjectTagging and UploadPart requests.

Confidence Score: 5/5

The PR appears safe to merge with no concrete correctness, concurrency, or security regressions identified.

The cached URL is copied before request-specific mutation, legacy-sensitive URL forms retain equivalent behavior, and the new tests exercise URL normalization, signing, body handling, and concurrent use.

Important Files Changed

Filename Overview
auth/signer.go Caches an immutable endpoint URL template and preserves legacy URL, host, fragment, body, and signing semantics when constructing each request.
auth/signer_request_test.go Provides focused regression coverage for URL normalization, signatures, request bodies, malformed endpoints, fragment behavior, and concurrent template reuse.
auth/signer_benchmark_test.go Measures serial and parallel request-signing performance using representative escaped paths and headers.
proxy/forwarder_signing_benchmark_test.go Adds controlled passthrough benchmarks for escaped tagging requests and parallel body-bearing multipart uploads.

Reviews (1): Last reviewed commit: "perf: avoid reparsing signing URLs" | Re-trigger Greptile

@ovaistariq
ovaistariq merged commit d8e74ac into main Aug 18, 2026
10 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-cwdfpdar3z branch August 18, 2026 01:44
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 18, 2026
@tigrisdata-argocd-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.17.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants