[Haskell-cafe] Benchmarking using instruction counting

Oleg Grenrus oleg.grenrus at iki.fi
Wed Jan 25 13:30:14 UTC 2023


Nice.

Fun coincidence: I have working on (very simple) perf_event_open 
bindings and did experiment with a fork of tasty-bench in 
https://github.com/phadej/libperf

perf_event_open is a Linux only syscall, and is relatively easy to use 
directly.

- Oleg

On 24.1.2023 15.21, Alexey Khudyakov wrote:
> Hello!
>
> I want to announce new benchmarking framework tasty-papi[1,2]
> Unlike criterion, gauge or tasty-bench is uses instruction
> counting instead of time measurements. It should be affected
> by OS scheduler much less so it should be possible to run
> benchmarks on CI. Although not on github CI (not enough
> permissions)
>
> For measurements papi[3] is used. So all hardware and OS
> limitations are inherited from there. At least it works on linux
> Here is example output:
>
> > 6:                OK (0.02s)
> >  ALLOC=528  TOT_INS=3609  TOT_CYC=4981  BR_INS=907  BR_MSP=58
> > 7:                OK
> >  ALLOC=864  TOT_INS=5518  TOT_CYC=5138  BR_INS=1378 BR_MSP=50
> > 8:                OK
> >  ALLOC=1408 TOT_INS=8614  TOT_CYC=6515  BR_INS=2142 BR_MSP=63
>
> For each benchmark we measure number of allocated bytes, number of 
> instructions and cycles spent as well as number of branching 
> instructions and branch mispredictions. Counter set could be adjusted 
> using command line flags.
>
> This library hasn't seen much real world use. So treat measurement 
> with care.
>
> [1] https://hackage.haskell.org/package/tasty-papi
> [2] https://github.com/Shimuuar/tasty-papi
> [3] https://icl.utk.edu/papi/
>
>  - Alexey
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list