Commit Graph

3 Commits

Author SHA1 Message Date
4f5f693547 feat: reporters and CLI suite
- reporter.zig: text table writer (Go-compatible columns, mean ± stddev
  when --count > 1) and ndjson writer, both driving std.Io.Writer.
- suite.zig: Suite holds registered (name, fn) entries, owns name
  storage, drives run/run_cli, and routes sub-benchmark calls back
  through a sub_run trampoline using current_name to compose
  parent/child paths. Parses --filter / --min-time / --count /
  --max-iters / --allocs / --format / --list / --help, with a small
  duration parser (1s, 500ms, 100us, 250ns).
2026-05-21 08:13:08 +03:00
e28eb3c22e feat: core runner — counting allocator, stats, Benchmark, adaptive N
Adds the measurement core:

- CountingAllocator: a thin wrapper over std.mem.Allocator vtable that
  tracks alloc/free counts and total bytes allocated, exposing a reset()
  used between attempts of the adaptive loop.
- stats.summarize: min / mean / sample stddev over an array of f64,
  used to aggregate --count repetitions.
- Benchmark: user-facing handle passed to each bench fn — n,
  allocator (counting-wrapped), io, with snake_case methods
  reset_timer / stop_timer / start_timer / set_bytes / report_allocs /
  keep / run (sub-bench). Times via std.Io.Timestamp.now(io, .awake).
- runner.run_one: galloping iteration count toward --min-time, with
  ×100 growth cap per step and "nice-number" rounding, matching Go's
  testing pkg heuristic.
2026-05-21 08:12:56 +03:00
be72707042 chore: project scaffold and build wiring
Initial Zig 0.16 build script wiring the public `zbench` module, the
`zbench_build` helper module for downstream `build.zig` files, an
internal `test` step, and an `example` step that compiles and runs the
bundled benchmark suite.
2026-05-21 08:12:45 +03:00