Announcement

Collapse
No announcement yet.

GCC vs. Clang Compiler Performance On Intel Meteor Lake

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GCC vs. Clang Compiler Performance On Intel Meteor Lake

    Phoronix: GCC vs. Clang Compiler Performance On Intel Meteor Lake

    Last week I posted a number of fresh GCC vs. LLVM Clang compiler performance benchmarks using an AMD Ryzen Threadripper PRO 7995WX (Zen 4) system using the HP Z6 G5 A workstation running Ubuntu Linux. For those wondering about the performance of GCC vs. Clang generated binaries on something much more modest, here are some benchmarks when testing on a Meteor Lake laptop with the Core Ultra 7 155H.

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Apart from custom Gentoo and the upcoming Serpent OS, are there any distros shipping packages compiled with Clang?

    Comment


    • #3
      Originally posted by Kjell View Post
      Apart from custom Gentoo and the upcoming Serpent OS, are there any distros shipping packages compiled with Clang?
      OpenMandriva is almost entirely built with Clang.

      Personally I would like to see even more distros built with Clang instead of GCC.

      Comment


      • #4
        Wow, this is quite unexpected!

        Comment


        • #5
          @MichaelLarabel some data which would be nice to include in the compiler performance tests, are some benchmarks comparing how fast the compiler toolchain generates resulting code, instead of just the speed of the resulting binaries. Clang used to be much faster but I haven't tested their compile time head to head for quite a few years. Has clang's compilation speed took a trade-off over the years after such heavy optimization or is it still a good % ahead of GCC?

          Comment


          • #6
            Originally posted by HeavensRevenge View Post
            @MichaelLarabelHas clang's compilation speed took a trade-off over the years after such heavy optimization or is it still a good % ahead of GCC?
            Yes llvm has gotten 2x slower in the past decade but is producing 15% faster binaries: https://zeux.io/2022/01/08/on-proebstings-law/

            Comment


            • #7
              I wish the order of the compilers were the same, in each graph. That would give me one fewer thing to look at, as I'm skimming through the results.

              I think this changed, recently?

              Comment


              • #8
                I am shocked by some of these results, particularly the encoder benchmarks.

                One would think that the developers would already be optimizing the code with either hand crafted SIMD or compiler intrinsics, so there shouldn't be any performance to be gained by switching out compilers.

                I also question the quality of the resulting binaries and whether or not there is any difference in the quality of the output produced by binaries compiled by one versus the other.

                I remember years ago a similar test between MS Visual C compiler and Intel's C compiler, Intel's compiler would produce faster binaries but it did so by swapping out generic code for Intel routines that in some cases resulted in incorrect output.

                In fact, I have run into something similar with Python and Fermat's Last Theorem.

                FLT is very difficult to speed up because of the triple nested loops and conditional checks, and i have been trying different techniques such as Python's Threading module, the Multiprocessing module, Numpy, OCL, OGL, HLSL and Numba.

                While I have been successful in speeding up the processing significantly, I am getting incorrect results, meaning each of these is doing something behind the scenes that is triggering the constitutional flagging FLT as being violated.

                Whenever I write any code I always write it in a generic fashion first, get a baseline result that matches what I was expecting then I work to optimize it and made sure that the output of the optimized code matches the output of the generic code.

                Comment


                • #9
                  Originally posted by sophisticles View Post
                  I am shocked by some of these results, particularly the encoder benchmarks.

                  One would think that the developers would already be optimizing the code with either hand crafted SIMD or compiler intrinsics, so there shouldn't be any performance to be gained by switching out compilers.
                  Why do you assume the gains were SIMD-related?

                  Originally posted by sophisticles View Post
                  I also question the quality of the resulting binaries and whether or not there is any difference in the quality of the output produced by binaries compiled by one versus the other.
                  Quality... in that you suspect one or the other might have bugs? I suppose it could happen, but each compiler suite has regression tests and these are official releases. If any of the generated code is buggy, it's probably not affecting more than a couple of the benchmarks.

                  Originally posted by sophisticles View Post
                  While I have been successful in speeding up the processing significantly, I am getting incorrect results, meaning each of these is doing something behind the scenes that is triggering the constitutional flagging FLT as being violated.
                  You know that floating point arithmetic is just an approximation, right? Furthermore, it's not associative. So, depending on how you factor the computation and what precision is used, you'll get different results.

                  Comment


                  • #10
                    Originally posted by user1 View Post

                    OpenMandriva is almost entirely built with Clang.

                    Personally I would like to see even more distros built with Clang instead of GCC.
                    No Thanks! Lets keep proprietary-able​ cuckware out of the Linux ecosystem.

                    Comment

                    Working...
                    X