performance comparison - gcc and llvm-gcc

谁都会走 提交于 2019-12-03 14:00:39

问题


I compared gcc and llvm-gcc with -O3 option on hmmer and mcf in spec cpu2006 benchmark. Surprisingly, I found gcc beat llvm-gcc for both cases. Is it because the -O3 has different meanings? How should I establish the experiments to get a fair comparison?

BTW, I did the experiment by ONLY changing cc in the makefile.

Thanks, Bo


回答1:


You seem surprised that gcc beat llvm on your benchmark. Phoronix hosts a bunch of interesting benchmarks in this area. For instance, have a look at:

  • Benchmarking LLVM & Clang Against GCC 4.5.
  • Compiler Benchmarks Of GCC, LLVM-GCC, DragonEgg, Clang

(Lots of luvverly colours.)

As far as How should I establish the experiments to get a fair comparison? goes, presumably you should compare the fastest runtime, fastest compile time, lowest memory footprint, most operations per Watt and scalability over number of CPUs (you pay your money and take your choice), for the fastest configuration of each compiler against the fastest configuration of the other(s).

First off, you need to at least establish the variability of each progam—how repeatable the variables are for each run of a single program on your platform. (Yes, believable benchmarking requires thoroughness on your part.)



来源:https://stackoverflow.com/questions/4694871/performance-comparison-gcc-and-llvm-gcc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!