perf: criterion benchmarks for the per-connection hot path
- benches/hot_paths.rs measures RateLimiter::check, Blacklist exact/CIDR/miss lookups, SubnetDetector::evaluate over 256 prefixes and HTTP request-head validation; `cargo bench --all-features --bench hot_paths`, HTML report in target/criterion. - Dev-machine medians recorded in docs/testing.md (~110 ns rate limit, ~70 ns exact ban lookup, ~220 ns CIDR lookup, ~2.6 us detector window, ~280 ns HTTP head). - Makefile `bench` target; the bench is gated on protocol-http.
This commit is contained in:
parent
08b7292ac4
commit
72c1f45d62
5 changed files with 369 additions and 7 deletions
|
|
@ -80,3 +80,10 @@ libc = { version = "0.2", optional = true }
|
|||
[dev-dependencies]
|
||||
# `ServiceExt::oneshot` drives the axum router in integration tests.
|
||||
tower = { version = "0.5", features = ["util"] }
|
||||
# Micro-benchmarks of the per-connection hot path (`cargo bench --all-features`).
|
||||
criterion = { version = "0.5", features = ["html_reports"] }
|
||||
|
||||
[[bench]]
|
||||
name = "hot_paths"
|
||||
harness = false
|
||||
required-features = ["protocol-http"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue