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:
Loki 2026-11-16 12:55:51 +01:00
parent 08b7292ac4
commit 72c1f45d62
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
5 changed files with 369 additions and 7 deletions

View file

@ -3,7 +3,7 @@
CARGO = cargo
TARGET_DIR = target
.PHONY: all build release test test-all check check-all fmt fmt-check clippy clean deny audit fuzz
.PHONY: all build release test test-all check check-all fmt fmt-check clippy clean deny audit fuzz bench
.PHONY: ebpf ebpf-clean
.PHONY: docker docker-build docker-up docker-down docker-logs
.PHONY: ci ci-full repo-gates
@ -78,6 +78,9 @@ docker-logs:
checkstyle: fmt-check clippy
@echo "✓ Checkstyle passed (rustfmt + clippy)"
bench:
$(CARGO) bench --all-features --bench hot_paths
# Parser fuzzing (nightly + cargo-fuzz). 60 s per target is a smoke run;
# longer campaigns are run locally before a release.
fuzz: