Re:ARMv7 vs. x86-64: Pathfinding benchmark of C++, D, Go, Ni...
by igouy on Sunday December 21, 2014 @12:02PM
(#8780158)
>>The article is wonderfully specific about what was used…<<
I'm missing something -- where does it say which version of JDK was used?
Re:ARMv7 vs. x86-64: Pathfinding benchmark of C++, D, Go, Ni...
by igouy on Sunday December 21, 2014 @02:23AM
(#8779208)
tl;dr
Measurement is highly specific -- the time taken for this benchmark task, by this toy program, with this programming language implementation, with these options, on this computer, with these workloads.
Same toy program, same computer, same workload -- but much slower.
Measurement is not prophesy.
The article is wonderfully specific about what was used, but one should be very careful extrapolating to different combinations. In addition to the compiler differences, note for example that although I did my tests on a processor running less than 1.5x faster, I got runtimes that were almost 2-3x faster. Most likely, this is because the Haswell processor I tested on is more efficient than the several generation old Westmere that the author used. There's nothing right or wrong about either choice, but the degree of difference is why it's always important to specify.
I glanced briefly at the code with 'perf record -F10000', and my quick conclusion was the the Intel version was running faster because it was making better use of the branchless cmov's than the other compilers, and thus has 10,000,000 fewer branch prediction errors. At 20 cycles per miss, this accounts for over half the difference between icpc and the others. The use of the new fast variable shift instructions (shlx) and the once-again fast bit test (bt) instruction is probably the rest of the difference.
The difference between g++ -O2 and -O3 seems to be that the -O3 version is doing almost everything off the stack rather than in registers. It's bad enough that this is probably a performance bug rather than intended behavior.