This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: time stamp counter in "make check"


On Wed, Jul 25, 2012 at 11:24:20AM -0700, Roland McGrath wrote:
> Using rdtsc or the like for user-mode CPU timings is always wrong.
> Even if the CPU issues are handled perfectly, it's only ever right
> when the luck of the draw doesn't introduce any scheduling delays
> in the middle of what you're timing.

rdtsc has error which is not important as you can get accurate result
by discarding top and bottom 1%. 

What is importatnt is bias for which cpuid/rdtscp causes more problems
that it solves. You must take account for cache coherence,speculative 
loads, lookahead. As these are function dependent you can get result 
that function A in two times faster that B while in reality B is twice
as fast as A.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]