Repository navigation
Bring the gateway benchmarks back into the build - #17
Merged
Merged
Conversation
benches/gateway_benchmarks.rs sat at the workspace root, and the root Cargo.toml is a virtual manifest, so no package ever built it. It had drifted from the middleware API too, so it wouldn't have compiled. It now lives in octopus-middleware with a [[bench]] entry, and the make bench-criterion target picks it up next to the farp bench. The port also fixes what it measured. The rate limit quota ran dry in the first few milliseconds, so most iterations would have timed 429s. Compression put the payload in the request, but the middleware compresses responses, so it measured nothing. The full stack signed its token with a different secret than it checked. Every group now sends one request first and asserts a 200 (and gzip where it should be), so a broken setup fails instead of quietly benchmarking an error path. A handler-only baseline gives you a floor to read the rest against.
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.
benches/gateway_benchmarks.rshas never run. It sat at the workspace root, and the rootCargo.tomlis a virtual manifest with no package to own it, so cargo never saw it. It had also drifted from the middleware API and wouldn't have compiled.It now lives in
crates/octopus-middleware/benches/with a[[bench]]entry and criterion as a dev-dependency.make bench-criterion(what the CI Benchmarks job runs) picks it up next to the farp bench, since that target already builds everybenches/target. You can run it on its own with:What changed in the bench
The groups are the same ones (JWT, rate limiting, compression at three sizes, the full stack), plus a handler-only baseline. Three of the originals would have timed the wrong thing even once they compiled:
text/plain.Each group now sends one request before timing and asserts a 200 (and
Content-Encoding: gzipfor the compression sizes), so a broken setup fails loudly.Numbers
From
make bench-criterionon an Apple Silicon Mac, fat LTO:The whole make target took about four minutes there, and the biggest process peaked at 4.5 GB, so the Benchmarks job stays well inside the runner after #16.
Checked locally
cargo fmt --all -- --checkcargo clippy -p octopus-middleware --all-targets --all-features -- -D warningson 1.99.1 and 1.88cargo test -p octopus-middleware --bench gateway_benchmarks(runs every group once)make bench-criterion