Benchmark, parity, and pressure-test tooling for the Gnalloy modular networking stack.
This module contains benchmark, parity, and pressure-test tooling. It is for measurement and regression protection, not for production runtime dependencies.
- Import path:
gnalloy.org/benchmarks - Repository:
github.com/gnalloy/benchmarks - Default branch:
dev - Preview install:
go get gnalloy.org/benchmarks@dev - License: Apache-2.0
GOWORK=off GOTOOLCHAIN=local go test ./... -count=1
go run ./cmd/gnalloy-microbench -module gnalloy -package buffer -benchtime 1s- Overview (中文)
- Usage (中文)
- Examples (中文)
- Configuration (中文)
- Testing and Performance (中文)
- API Reference (中文)
- Notes and Caveats (中文)
- ADR-001 Module Boundary (中文)
- ADR-002 Benchmark Ownership (中文)
This repository owns: Benchmark, parity, and pressure-test tooling for the Gnalloy modular networking stack.
It does not absorb neighboring module responsibilities. Core primitives stay in gnalloy.org/gnalloy; protocol codecs, transports, handlers, resolvers, examples, and benchmarks stay in their own repositories.
gnalloy.org/benchmarks/benchdiff(benchdiff)gnalloy.org/benchmarks/cmd/gnalloy-benchdiff(main)gnalloy.org/benchmarks/cmd/gnalloy-microbench(main)gnalloy.org/benchmarks/cmd/bench-client(main)gnalloy.org/benchmarks/cmd/parity-bench(main)gnalloy.org/benchmarks/cmd/stress-client(main)gnalloy.org/benchmarks/cmd/stress-check(main)gnalloy.org/benchmarks/cmd/gnalloy-parity(main)gnalloy.org/benchmarks/external/internal/benchh3(benchh3)gnalloy.org/benchmarks/external/internal/benchtls(benchtls)gnalloy.org/benchmarks/microbench(microbench)gnalloy.org/benchmarks/parity(parity)
gnalloy.org/codec-http1gnalloy.org/codec-http3gnalloy.org/gnalloygnalloy.org/transport-http3gnalloy.org/transport-quic
- Run package microbenchmarks from this repository with
go run ./cmd/gnalloy-microbench -module gnalloy -package buffer -bench '^BenchmarkHeapAllocatorAcquireRelease$'. - Compare a module's
HEADto its working tree withgo run ./cmd/gnalloy-benchdiff -packages gnalloy/buffer -bench '^BenchmarkHeapAllocatorAcquireRelease$';-suite hotpathselects a predefined set. Both commands assume sibling checkouts by default; use-workspaceotherwise. - Configure scenario, protocol, payload size, concurrency, warmup count, measured repetitions, timeout, and report output before comparing results.
- Report throughput and latency separately. Do not compare numbers collected on different hosts as a ranking.
- Use
cmd/gnalloy-parity -matrix linux-fullor-matrix windows-fullto generate the full TCP, UDP, QUIC, HTTP/1, HTTP/2, HTTP/3, and TLS parity matrix.
The generated API reference lists the full public surface. Common constructors or option types currently include:
var ErrInvalidRunner = errors.New("gnalloy/benchmarks/benchdiff: invalid runner") ...type Config struct{ ... }type Config struct{ ... }const ProtocolHTTP1 = "http1"type Config struct{ ... }const DefaultServerName = "gnalloy.local"var ErrInvalidSpec = errors.New("gnalloy/benchmarks/parity: invalid spec") ...type ExternalHarnessOptions struct{ ... }
GOWORK=off GOTOOLCHAIN=local go test ./... -count=1
GOWORK=off GOTOOLCHAIN=local go vet ./...
go run ./cmd/gnalloy-microbench -module gnalloy -package buffer -benchtime 1sFor pressure tests, assemble the relevant transport, codec, and handler stack and run the clients from this repository. Keep host, operating system, payload, concurrency, warmup, and repetitions in the report.
- This repository owns performance measurements; applications assemble cross-module behavior and examples demonstrate ordinary usage.
- Public APIs should remain Go-native and explicit; avoid runtime scanning, hidden global registries, and reflection-heavy behavior in hot paths.
- Treat network input as untrusted. Configure parser limits and return typed errors instead of panics.
- Keep benchmark claims tied to a concrete host, operating system, protocol, payload, concurrency, warmup, and repetition count.