aboutsummaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-10 15:20:20 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commitb1742da3868a3594b4e78be64e1412356d95dbd7 (patch)
treeb2d2a4988ca60c5607f986df548cd6ed0c5e47ac /bench
parentae3bf36c83befeaac21900495e6494ec2a39e225 (diff)
downloadffwd-b1742da3868a3594b4e78be64e1412356d95dbd7.tar.gz
ffwd-b1742da3868a3594b4e78be64e1412356d95dbd7.zip
bench: progress output during sampling, ignore .gitignore in dirty stamp
Diffstat (limited to 'bench')
-rw-r--r--bench/bench.h10
1 files changed, 8 insertions, 2 deletions
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++) {