Slashdot Mirror


Speed Test: Comparing Intel C++, GNU C++, and LLVM Clang Compilers

Nerval's Lobster writes "Benchmarking is a tricky business: a valid benchmarking tries to remove all extraneous variables in order to get an accurate measurement, a process that's often problematic: sometimes it's nearly impossible to remove all outside influences, and often the process of taking the measurement can skew the results. In deciding to compare three compilers (the Intel C++ compiler, the GNU C++ compiler (g++), and the LLVM clang compiler), developer and editor Jeff Cogswell takes a number of 'real world' factors into account, such as how each compiler deals with templates, and comes to certain conclusions. 'It's interesting that the code built with the g++ compiler performed the best in most cases, although the clang compiler proved to be the fastest in terms of compilation time,' he writes. 'But I wasn't able to test much regarding the parallel processing with clang, since its Cilk Plus extension aren't quite ready, and the Threading Building Blocks team hasn't ported it yet.' Follow his work and see if you agree, and suggest where he can go from here."

2 of 196 comments (clear)

  1. Crappy benchmark by raxx7 · · Score: 5, Informative

    The code in the benchmark runs a parallel for over a 10 billion element array but in steps of 100 elements.
    It's going to be limited by the creation and destruction of threads.

    Also, by not initializing the input array, the floating point arithmetic is vulnerable to eventual denormal values.

  2. Re:Compile time is irrelevant. by rfolkker · · Score: 5, Informative

    I have worked on projects that have taken upwards of 8 hours for a full compile. There is a lot of validity behind the business impact of different compilers.

    The current mentality of throw more horse power at a problem is not always the practical, or the logical conclusion. If you can improve your overall compile time, it can improve your productive time.

    From a Build Engineering perspective, analyzing why it takes time for a project to compile is one of the most important metrics.

    Not only do I monitor how long a project takes to compile, but I also keep an active average, and try to maintain highs and lows to identify compile spikes.

    We monitor processor(s), disk access speeds, memory loads, build warnings, change size, concurred builds, etc.

    We look at all possible solutions. With the current build tools we have, we can either provision another build system for the queue, or if necessary increase memory, or disk space, or faster drives, more processors, or even upgraded software. We have gone as far as home-grown fixes to get around issues until better solutions become available.

    All of this needs to be accounted for, so, not only is compile time relevant, but what is CAUSING compile times is relevant.