Agner`s CPU blog

Software optimization resources | E-mail subscription to this blog | www.agner.org

Test results for Intel's Sandy Bridge processor
Author:  Date: 2015-12-24 04:04
Hi all, I have three haswell machines, so I decided to test this phenomena on all of them. I'm not doing some exact measurements of cycles using MSR's, I used my old program that I created around two years ago to test FMA implementation of Bresenham's line algorithm. I calculate pixels of rasterized line and I measure the calculation duration using RDTSC, but the results are telling something about this warm-up effect. I am calculating the same line in 100 consecutive cycles, in ideal conditions, single iteration should take around 600 cycles. Now the results:

machine 1: this is my personal desktop pc with Core i7-4770K, I bought it right when the haswell cpu's were released, in june 2013.
first iteration takes cca 4000 cycles, second 2000 cycles and then third iteration takes more than 30000 cycles. All subsequent iterations take 600 cycles. The long third iteration is not caused by context switch or something, since the results are consistent between multiple runs or pinning to single core.
machine 2: work laptop with Core i7-4700MQ, bought in autumn 2013
the results are consistent with the first machine, with slight differences, first iteration cca 5000 cycles, second 2000 cycles, third 22000 cycles, subsequent iterations 600 cycles
both machines are running windows 10
the results in linux are only slightly different, there the first iteration takes cca 32000 cycles and subsequent iterations 600 cycles (maybe the difference is caused by intel P-state driver in linux?)

now I don't remember exact results of my experiments when I created this program two years ago, but I think that this "third iteration slowdown" wasn't happening back then, only a few longer iterations at start and then the rest of the iterations were fast.
the only change which happened during last two years was that I updated bios on both machines, which updated the cpu microcode. Current microcode revision of both cpus is 0x1E. (cpuid revision 0x306C3, stepping C0, platform ID of the first is 0x3E/0x02, second 0x27/0x10)

machine 3: this is new powerful workstation that we bought in work with Core i7-5820k. Here the results are quite different
first iteration takes cca 6000 cycles, then there are 5 iterations that take 1800 cycles and all subsequent iterations take 600 cycles. There is not that long transition iteration with over 20000 cycles.
This machine is running windows 8.1 and microcode revision is 0x29, CPUID revision 0x306F2, platform id 0x49/0x04, stepping R2.

So, my uneducated guess is that this behavior might be caused also by the different versions of microcode. I might try downgrading the bios of my desktop and try these tests with older microcode

 
thread Test results for Intel's Sandy Bridge processor new - Agner - 2011-01-30
reply Test results for Intel's Sandy Bridge processor new - PaulR - 2011-02-15
replythread AVX2 new - phis - 2011-06-23
last reply AVX2 new - Agner - 2011-06-23
replythread Test results for Intel's Sandy Bridge processor new - anon - 2013-08-01
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2013-08-06
last replythread Test results for Intel's Sandy Bridge processor new - anon - 2013-08-07
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2013-08-07
last replythread Test results for Intel's Sandy Bridge processor new - anon - 2013-08-07
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2013-08-08
last replythread Test results for Intel's Sandy Bridge processor new - anon - 2013-08-08
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2013-08-09
last replythread Test results for Intel's Sandy Bridge processor new - anon - 2013-08-09
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2013-08-10
last reply Test results for Intel's Sandy Bridge processor new - Agner - 2013-08-10
replythread Test results for Intel's Sandy Bridge processor new - John D. McCalpin - 2013-10-09
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2013-10-10
last replythread Test results for Intel's Sandy Bridge processor new - John D. McCalpin - 2013-10-11
last replythread SB's L1D banks new - Tacit Murky - 2013-11-03
last reply SB's L1D banks new - John D. McCalpin - 2013-11-07
replythread Test results for Intel's Sandy Bridge processor new - John D. McCalpin - 2015-08-18
replythread Test results for Intel's Sandy Bridge processor new - Agner - 2015-08-18
last replythread Test results for Intel's Sandy Bridge processor new - John D. McCalpin - 2015-08-24
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2015-08-25
last reply Test results for Intel's Sandy Bridge processor new - John D. McCalpin - 2015-08-25
replythread Haswell upper128 power gating new - Peter Cordes - 2015-08-28
last replythread Haswell upper128 power gating new - Agner - 2016-01-16
last replythread Haswell upper128 power gating new - John D. McCalpin - 2016-01-29
last reply Haswell upper128 power gating new - Agner - 2016-01-30
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2015-12-20
last replythread Test results for Intel's Sandy Bridge processor new - John D. McCalpin - 2015-12-21
last replythread Test results for Intel's Sandy Bridge processor new - Agner - 2015-12-22
reply Test results for Intel's Sandy Bridge processor - Robert - 2015-12-24
last replythread Test results for Intel's Sandy Bridge processor new - Just_Coder - 2015-12-25
last reply Test results for Intel's Sandy Bridge processor new - Agner - 2015-12-26
last replythread Test results for Intel's Sandy Bridge processor new - Just_Coder - 2015-08-23
last reply Test results for Intel's Sandy Bridge processor new - Agner - 2015-08-25