Announcement

Collapse
No announcement yet.

Building The Linux Kernel With LLVM's Clang Yields Comparable Performance

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

  • Building The Linux Kernel With LLVM's Clang Yields Comparable Performance

    Phoronix: Building The Linux Kernel With LLVM's Clang Yields Comparable Performance

    With the upstream Linux kernel nearly compatible with LLVM's Clang compiler as an alternative to using GCC, I benchmarked the latest "LLVMLinux" code that's the Linux kernel compiled under Clang with some out-of-tree patches to see how its performance compares to a conventionally built kernel with GCC 4.8.

    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
    Good for Clang, bravo to the devs.
    All opinions are my own not those of my employer if you know who they are.

    Comment


    • #3
      Why not compare both with a build of the kernel under icc? Last I knew, they still ensured that the kernel built with the Intel toolchain...

      Comment


      • #4
        A pointless comparison for one very important reason.

        For normal tasks the kernel uses very little CPU time so you won't feel the difference between different compilers, or between different optimization levels.

        One way to really test the compiler will be to, for instance, run x264 encoding using 16 threads when you only have 4 CPU cores.

        Another interesting way will be to test a throughput of a high speed L2TP connection - the kernel will be really stressed in this case.

        Actually I can think of a dozen of different ways to really test the kernel performance, but this article has none of them.

        Comment


        • #5
          Originally posted by birdie View Post
          A pointless comparison for one very important reason.

          For normal tasks the kernel uses very little CPU time so you won't feel the difference between different compilers, or between different optimization levels.

          One way to really test the compiler will be to, for instance, run x264 encoding using 16 threads when you only have 4 CPU cores.

          Another interesting way will be to test a throughput of a high speed L2TP connection - the kernel will be really stressed in this case.

          Actually I can think of a dozen of different ways to really test the kernel performance, but this article has none of them.
          I think if you`d see significant differences then it would mean something is really broken.
          The time spend in code for kernel switching processes is minimal (the switching itself is more expensive), its when, how often and the strategy involved that gives you measurable run time differences.

          Comment


          • #6
            Originally posted by birdie View Post
            A pointless comparison for one very important reason.

            For normal tasks the kernel uses very little CPU time so you won't feel the difference between different compilers, or between different optimization levels.

            One way to really test the compiler will be to, for instance, run x264 encoding using 16 threads when you only have 4 CPU cores.

            Another interesting way will be to test a throughput of a high speed L2TP connection - the kernel will be really stressed in this case.

            Actually I can think of a dozen of different ways to really test the kernel performance, but this article has none of them.
            Huh, are you claiming that a Phoronix compiler benchmark is flawed or somehow biased towards LLVM?!

            Comment


            • #7
              I miss numbers about the time it needs to compile a kernel with LLVM compared to GCC.

              Comment


              • #8
                Interesting benchmarks, but comparing not-yet released LLVM/Clang 3.5 to a GCC 4.8 which is already one release behind seems not very fair.

                Comparing Clang 3.4.1 to GCC 4.9.0 would have been at least fair, or Clang 3.5 to GCC 4.10.

                Comment


                • #9
                  Originally posted by Vim_User View Post
                  I miss numbers about the time it needs to compile a kernel with LLVM compared to GCC.
                  That's what I was looking for, the performance of the compiler itself. The resulting output is (ideally) expected to be very close to identical, but if the cost of the compile time varies greatly, there's little benefit to using the slower compiler.

                  Comment


                  • #10
                    Originally posted by caligula View Post
                    Huh, are you claiming that a Phoronix compiler benchmark is flawed or somehow biased towards LLVM?!
                    He never mentioned either GCC or LLVM. The test results show no measurable differences between the two compilers. So where the hell did you just pull that out of?

                    Comment

                    Working...
                    X