Add LinuxPerf extension for branch + instruction counts#375
Add LinuxPerf extension for branch + instruction counts#375topolarity wants to merge 2 commits intoJuliaCI:mainfrom
LinuxPerf extension for branch + instruction counts#375Conversation
e526c5d to
0b21870
Compare
f704993 to
2bedf53
Compare
2bedf53 to
21ca9cd
Compare
This updates the core BenchmarkTools types to include `instructions` and `branches` fields. These fields support serialization and all of the usual stats / judgements via the Trial / TrialEstimate / TrialRatio interface. If the extension is not available or `perf` is not configured correctly on your system, these are `NaN`. This also keeps the serialization format backwards-compatible, reporting any missing measurements as `NaN`.
21ca9cd to
9be1101
Compare
|
It'd be good to get some feedback on this (cc @vchuravy) I'd really like to get cycle counts into our nanosoldier reports - the wall time measurements are quite noisy |
giordano
left a comment
There was a problem hiding this comment.
I like the idea of including hardware counters! Would it be possible to include also the cycles count, so that one can get the instructions-per-cycle count as well? 👀
| UUIDs = "<0.0.1, 1" | ||
| julia = "1.6" | ||
| julia = "1.9" | ||
| LinuxPerf = ">= 0.4" |
There was a problem hiding this comment.
This type of unbound specifiers aren't accepted in the registry
| LinuxPerf = ">= 0.4" | |
| LinuxPerf = "0.4" |
Sounds reasonable to me - apparently on Skylake the cycle counter has a dedicated counter too, so it shouldn't cause more PMU muxing if |
This PR adds a straightforward extension for
LinuxPerfand updates the coreTrial/TrialEstimate/ etc. types to include "instructions" and "branches" fields, with the usual stats + serialization + judgement support.If
LinuxPerfis not loaded, instruction/branch counts are returned asnothingfrominstructions(t),branches(t), etc. (internally they are stored asNaN)This is an alternative to #347, which tries to provide a fully-generic interface. In contrast, this PR focuses on updating the core datatypes to make room for instruction / branch counts and LinuxPerf is just one possible source for those counts.