hyperfine icon indicating copy to clipboard operation
hyperfine copied to clipboard

Advanced metrics beyond wall time (CPU time, instruction count, ...)

Open intelfx opened this issue 1 year ago • 3 comments

While there certainly have been similar feature requests that were all shot down (#135, #153, #170 etc.) I believe this one is materially different. It is also somewhat related to #660, but again different.


While hyperfine has rudimentary support for measuring detailed process times (user/system time) and displaying them along the wall clock time in the CLI report, they are not the primary metric (the one whose mean+deviation is shown, the one that hyperfine uses for statistical analysis and also presumably for outlier detection etc.).

I propose to implement a fixed set of additional metrics that could be selected instead of wall time as the "benchmark target", i.e. the primary measurement that is fed into all of hyperfine's machinery.

Obvious ideas are total CPU time, user time and system time (e.g. if I wanted to measure multiprocessing overhead, I would run hyperfine with the parallelism factor as the parameter and CPU time as the metric).

Less obvious metrics are various hardware performance counters as measured by perf — for instance, instruction count, cycles count, or perhaps just arbitrary perf expressions. Naturally, these would be Linux-only. The instruction count, in particular, is the metric that the Rust compiler team uses to benchmark rustc (ref.), so there is certainly some value in adopting it or similar.

intelfx avatar Mar 21 '24 09:03 intelfx

I like this idea. Let's start by working on the CLI design for this.

sharkdp avatar Jun 23 '24 11:06 sharkdp

Relative: https://github.com/andrewrk/poop/

inflation avatar Aug 31 '24 23:08 inflation

Build the feature for the CLI in #783 if the pull request excepted then we can easily add the more information to the cli and the extracted data