sltbench icon indicating copy to clipboard operation
sltbench copied to clipboard

Measure cycles instead of time

Open rolandschulz opened this issue 7 years ago • 2 comments

It might be nice if as an alternative to measuring time you also supported measuring cycles (using perf_event_open). That would make it less important to fix frequency (for non memory bound functions).

rolandschulz avatar Sep 13 '17 01:09 rolandschulz

PS: It would probably be easiest to use https://github.com/andikleen/pmu-tools/tree/master/jevents if one wants to support measuring cycles (the required code is small and could just be included if you want to avoid a dependency) . This solution is Linux only. I'm not aware of any cross-platform library. But if it is an optional feature that might be fine. If it needs to also work on MacOS and Windows one would need to use other libraries such as https://msdn.microsoft.com/en-us/library/windows/desktop/dd796399(v=vs.85).aspx and https://github.com/opcm/pcm/tree/master/MacMSRDriver PPS: One could also measure instructions which might be useful in some cases.

rolandschulz avatar Sep 13 '17 22:09 rolandschulz

Thanks for info.

Ok, I will try to add feature.

(unfortunately, I cannot give any promise about deadline)

ivafanas avatar Sep 20 '17 05:09 ivafanas