Category Archives: CPU

CPU hardware

Single threaded performance got stuck

I fell in love with md5 hash algorithm because it can detect some very interesting characteristics of system which I want to benchmark. Almost all computations which need to be performed during computation of md5 hash sum are lying in critical path. It means that it’s almost impossible to parallelize md5 hash sum computation. And I’m not talking about execution in multiple threads, but about instruction level parallelization(superscalar and vector computing). So this feature excluding any new modern tricks used in CPU cores(like out-of-order execution and specialized instruction sets) out of equation and makes it perfect single thread benchmark.
Let’s see some numbers:
Calculate md5(10GiB of zerroes) on i5-760(Turbo frequency: 3.33 GHz, launch date Q3’10)(with Ubuntu 14.04)

And then do the same on i7-6700(Turbo frequency: 4.0 GHz, launch date Q3’15)(with Ubuntu 15.10)

So we have 140 and 155 MB/s per GHz respectively. It is 10.7% performance boost after 5 years of CPU evolution. And it looks so frustrating.
p.s. Yep, I know that CPU now much smarter than 5 years ago and have rich set of specialized instruction sets(like AES-NI which is responsible for +2200% ghash calculation speed). But any software developer should be ready for that fact that unparallelizeable algorithms execution will not become faster for even a bit in near future.

CPU hardware power

Few words about power management

Not so long time ago I’ve faced with problem: on the same linux distributive some machines use Inte Turbo Boost but some others didn’t.
So… To investigate this problem I’ve read enough article about power management and want to summarize key aspects below.
Holy Grail of power management is ACPI(Advanced Configuration and Power Interface). It describes sleep(Sx), processor(Cx) and performace(Px) states.
Performance states came to replace legacy throtling(Tx) states.

  • S5(“Soft-Off”) All hardware is in off state.
  • S4(“Suspend to disk”) S5 + bootloader can determine this state + WOL available
  • S3(“Suspend to RAM”) RAM state preserved as well as S3 capable devices
  • S2(“Standby”) Almost the same as S3
  • S1(“Power On Suspend/Stopgrant”) All power on, but Hard Drives and not S1 capable devices is in off state, CPU is stopped.
  • S0 The system is turned on. Cx states is S0 substates
    • C3(“Sleep”) cache not preserved
    • C2(“Stop-Clock”) all preserved but clock is off
    • C1(“Halt”) all preserved but CPU do nothing
    • C0 is operating state. Px states is C0 substates
      • Pn Minimum frequency
      • P1 Maximum base frequency
      • P0 TurboBoost enabled

So… About TurboBoost issues solution. It was just a BIOS bug(or feature? Who knows?) that doesn’t moved cpu to P0 state on some boards and does on another.