Add optional iterations output to libtest benchmark

dad6164
Opened by llogiq at 2023-09-24 23:24:23

The ns / iter output of libtest's benchmarking harness can hide subtle differences for fast operations (also for some programs you just want to measure throughput). Could we have an option to output the number of iterations per second instead?

I note that src/libtest/lib.rs has a fn ns_per_iter(&mut self) which calculates this and should be easy enough to extend.

  1. Triage: no change

    Steve Klabnik at 2017-01-03 20:26:40

  2. Triage: no change

    Timo Carlin-Burns at 2017-12-04 04:25:03

  3. Triage: Can you provide example commands with example output and desired output please? That makes it easier to quickly understand this enhancement request. Thanks!

    Martin Nordholts at 2023-09-24 16:39:27

  4. It's a bit late; most serious benchmarking has moved to criterion or iai, which both have options to output throughput.

    I opened this issue 7 years ago when both of those options didn't yet exist. I'll leave the issue open for now, perhaps there is still a soul using nightly's libtest bencher for some reason.

    llogiq at 2023-09-24 23:24:23