bench/

directory
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0

README

Benchmarks

make bench runs, on the reference machine (MacBook Pro M3 Pro 36 GB, Docker VM 8 CPU / 20 GB):

  1. the micro benchmarks of the pure packages (go test -bench . ./internal/..., 6 counts each, compare runs with go tool benchstat out/bench/micro.txt);
  2. each performance acceptance criterion 3 times through bench/cmd/results, which writes RESULTS.md with the median and min-max of every measurement and the raw JSON and logs to out/bench/ (gitignored).
Scenario Criterion What runs
Throughput FMN-04 1M no-op jobs pre-filled and topped up, 4 clients x 50 workers, 5 minutes; then the same with fairness and a per-key limit of 50 over 1,000 keys
Pickup latency FMN-05 1,000 single-job inserts per second for 2 minutes (after 10 s warm-up); attempted_at - created_at
Fairness FMN-06 50 ms jobs, 4 x 50 workers (C = 4,000 jobs/s); 240,000 backlog of tenant A, then A at 0.8 C and B at 0.04 C (Poisson) for 2 minutes; fair, unfair and B alone
Soak FMN-12 1 hour at 1,000 jobs/s, 5-minute retention, cleaner every second, reindex every 10 minutes

Method: Foreman clients run natively on the host in the test process; only Postgres 17 runs in Docker (deploy/docker-compose.yml, settings in that file). Load is open model: inserts follow a fixed rate and never wait for workers. Run one scenario with go run ./bench/cmd/results -only FMN-05 -runs 1.

CI runs the same criteria once with the CI thresholds (make acceptance CI=1).

Directories

Path Synopsis
cmd
explain command
Command explain loads 1M and 10M jobs, records EXPLAIN (ANALYZE, BUFFERS) of the fetch queries and times fetch rounds, and prints the results as Markdown.
Command explain loads 1M and 10M jobs, records EXPLAIN (ANALYZE, BUFFERS) of the fetch queries and times fetch rounds, and prints the results as Markdown.
results command
Command results runs the performance criteria several times through the acceptance tests and writes bench/RESULTS.md with the median and min-max of each measurement.
Command results runs the performance criteria several times through the acceptance tests and writes bench/RESULTS.md with the median and min-max of each measurement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL