diff options
author | Niklas Haas <[email protected]> | 2025-03-31 15:05:37 +0200 |
---|---|---|
committer | Niklas Haas <[email protected]> | 2025-09-01 19:27:53 +0200 |
commit | faf62cbdf5df78884c47b57aac74df3461052974 (patch) | |
tree | ac193922062527fa98dba69e2dbdc2ca85ee6079 /tests/checkasm/checkasm.c | |
parent | 5a28f392b90397d9cc9c40646c5d9529c8851f52 (diff) |
tests/checkasm: increase number of runs in between measurements
Sometimes, when measuring very small functions, rdtsc is not accurate enough
to get a reliable measurement. This increases the number of runs inside the
inner loop from 4 to 32, which should help a lot. Less important when using
the more precise linux-perf API, but still useful.
There should be no user-visible change since the number of runs is adjusted
to keep the total time spent measuring the same.
Diffstat (limited to 'tests/checkasm/checkasm.c')
-rw-r--r-- | tests/checkasm/checkasm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 968961c03c..cd6063f508 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -637,7 +637,7 @@ static inline double avg_cycles_per_call(const CheckasmPerf *const p) if (p->iterations) { const double cycles = (double)(10 * p->cycles) / p->iterations - state.nop_time; if (cycles > 0.0) - return cycles / 4.0; /* 4 calls per iteration */ + return cycles / 32.0; /* 32 calls per iteration */ } return 0.0; } |