Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timing code on Intel CPUs using "core clock cycles"?

What is this method of timing code on Intel processors, referred to by Agnor fod as "core clock cycles":

http://gcc.gnu.org/ml/gcc/2008-07/msg00424.html

My test results, referred to above, uses the "core clock cycles" performance counter on Intel and RDTSC on AMD. It's the highest resolution you can get.

I always thought RDTSC was the best way to measure on Intel CPUs too? What is this other technique he speaks about and how do you measure using it?

like image 951
user997112 Avatar asked Aug 07 '26 18:08

user997112


1 Answers

He is referring to the Intel PCM, the Performance Counter Monitor.

http://software.intel.com/en-us/articles/intel-performance-counter-monitor-a-better-way-to-measure-cpu-utilization

By the way in the original post linked article, http://www.agner.org/optimize/optimizing_cpp.pdf

the poster explicity refers to it:

The time stamp counter is a little inaccurate on microprocessors that can change the clock frequency (Intel SpeedStep® technology). A more accurate measurement can be obtained with a performance monitor counter for "core clock cycles", using the test program mentioned above

like image 66
ouah Avatar answered Aug 10 '26 07:08

ouah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!