diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-10 15:20:20 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | b1742da3868a3594b4e78be64e1412356d95dbd7 (patch) | |
| tree | b2d2a4988ca60c5607f986df548cd6ed0c5e47ac | |
| parent | ae3bf36c83befeaac21900495e6494ec2a39e225 (diff) | |
| download | ffwd-b1742da3868a3594b4e78be64e1412356d95dbd7.tar.gz ffwd-b1742da3868a3594b4e78be64e1412356d95dbd7.zip | |
bench: progress output during sampling, ignore .gitignore in dirty stamp
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | bench/bench.h | 10 |
2 files changed, 11 insertions, 3 deletions
@@ -282,7 +282,9 @@ bench-tokenizer: # a JSON sample set under bench/results/, keyed by commit; compare two # records with scripts/benchstat.py to see if a change helped or hurt. # ============================================================================= -BENCH_STAMP = $(shell git rev-parse --short HEAD 2>/dev/null || echo nogit)$(shell git diff --quiet 2>/dev/null || echo -dirty)-$(shell date +%Y%m%d-%H%M%S) +# Dirtiness ignores .gitignore so local-only ignore entries do not mark +# every record as -dirty. +BENCH_STAMP = $(shell git rev-parse --short HEAD 2>/dev/null || echo nogit)$(shell git diff --quiet -- ':!.gitignore' 2>/dev/null || echo -dirty)-$(shell date +%Y%m%d-%H%M%S) BENCH_CC_FLAGS = -Wall -Wextra $(CFLAGS_BASE) $(TEST_BLAS_CFLAGS) -I. bench: diff --git a/bench/bench.h b/bench/bench.h index e26a05d..2c98d5c 100644 --- a/bench/bench.h +++ b/bench/bench.h @@ -163,16 +163,22 @@ static int bench_main(const bench_opts_t *o, } iters[c] = n; ran++; + fprintf(stderr, "calibrated %-44s n=%ld\n", cases[c].name, n); } /* Sample round-robin so slow machine drift (thermals, scheduling) * lands inside every benchmark's sample spread instead of shifting - * whole benchmarks against each other. */ - for (int s = 0; s < o->count; s++) + * whole benchmarks against each other. Results print after the + * last pass; the pass lines are the progress indicator. */ + double sample_t0 = bench_now_ns(); + for (int s = 0; s < o->count; s++) { for (int c = 0; c < n_cases; c++) if (iters[c]) all[(size_t)c * o->count + s] = bench_run_once(cases[c].fn, iters[c]); + fprintf(stderr, "pass %d/%d (%.0fs elapsed)\n", s + 1, o->count, + (bench_now_ns() - sample_t0) / 1e9); + } int emitted = 0; for (int c = 0; c < n_cases; c++) { |
