Announcement

Collapse
No announcement yet.

GCC Optimization Level Benchmarks With A 4GHz Intel Skylake CPU On Ubuntu 64-bit

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

  • GCC Optimization Level Benchmarks With A 4GHz Intel Skylake CPU On Ubuntu 64-bit

    Phoronix: GCC Optimization Level Benchmarks With A 4GHz Intel Skylake CPU On Ubuntu 64-bit

    With it being trivial to deploy new benchmark test cases with the Phoronix Test Suite and it being fully-automated, the latest results of our Xeon E3 v5 Skylake CPUs are some GCC reference benchmarks with various optimization levels to see the impact on the performance of the generated binaries as well as build time...

    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
    Those are some pretty major performance deltas and it leads one to wonder if Linux distros should be a little more agressive in package compilations, especially for performance critical libraries and programs.

    In particular, most 64-bit distros are using a very generic set of compiler flags that are designed for full compatibility with 64-bit X86 parts going all the way back to 2003. That's fine for some purposes, but there's clearly a large chunk of performance being left on the floor for performance critical code.

    Comment


    • #3
      Originally posted by chuckula View Post
      Those are some pretty major performance deltas and it leads one to wonder if Linux distros should be a little more agressive in package compilations, especially for performance critical libraries and programs.

      In particular, most 64-bit distros are using a very generic set of compiler flags that are designed for full compatibility with 64-bit X86 parts going all the way back to 2003. That's fine for some purposes, but there's clearly a large chunk of performance being left on the floor for performance critical code.
      That's what intel's clear Linux is doing, among other optimizations.
      Michael Larabel
      https://www.michaellarabel.com/

      Comment


      • #4
        Any chance I might request that -0g gets added to the set? I'm always curious how big the gulf between -O0 and -Og is ever since they added -Og in GCC 4.8

        Comment


        • #5
          Wow, -march=native actually makes a small but noticeable difference in every test. I guess those gentoo guys are on to something.

          Comment


          • #6
            Originally posted by flubba86 View Post
            Wow, -march=native actually makes a small but noticeable difference in every test. I guess those gentoo guys are on to something.
            AFAIK only a few selected apps deploys compiler optimizations. You can build a custom repo of these apps with the mentioned compiler flags on your distro for this purpose; no need to compile everything.

            Comment


            • #7
              Originally posted by Modu View Post

              AFAIK only a few selected apps deploys compiler optimizations. You can build a custom repo of these apps with the mentioned compiler flags on your distro for this purpose; no need to compile everything.
              As far as I know, the reason that -march=native makes such a difference in this instance is because the compiler allows itself to use features of the CPU like popcount, AVX/SIMD instructions, SSE, etc. Even without you providing any explicitly optimized intrinsics for your program, you're telling GCC that you don't care about portability and you want it to identify situations where the CPU features could be used to speed up operations.

              The reason it makes such a difference in these tests is because these are very feature-heavy CPUs which have lots of built-in instructions which infer optimizations GCC can make. I would think that the cheaper the CPU is, the less likely -march=native would be to have any noticeable impact. If you've got a brand-new i7? Gentoo will likely make that difference even more apparent! For certain extremely intensive programs (like ffmpeg/avconv or games, etc), they can help GCC/LLVM along even more by providing code structured such that it's easy for the optimizer to spot SIMD/AVX swappable pieces, or just provide assembly sections alongside their C-counterparts.

              Pretty much everything benefits from better compiler optimization choices, but the binaries you make will only work for other people with the same CPU features. That's why distributions normally choose to limit how many optimization flags they turn on to make all the binaries compatible with more users!
              Last edited by kscz; 28 February 2016, 09:13 PM. Reason: Added a little clarification

              Comment


              • #8
                You want to have a compiled kernel linux-libre in CFLAGS -Ofast + -march=native ?

                use this script:

                Free, secure and fast downloads from the largest Open Source applications and software directory - SourceForge.net



                Comment


                • #9
                  Originally posted by 4d4c47 View Post
                  You want to have a compiled kernel linux-libre in CFLAGS -Ofast + -march=native ?

                  use this script:

                  https://sourceforge.net/projects/scr....3.sh/download


                  https://sourceforge.net/projects/scr...?source=navbar
                  Does that actually cause the compiler to use native features when building the kernel? Im only asking because I believe that for the mainline kernel the kbuild build system ignores what is passed into -march on the commandline, and uses the value selected in the Processor Type config entry in the kconfig (so basically Core 2 Duo is the highest feature set you can choose).

                  Comment


                  • #10
                    Originally posted by flubba86 View Post

                    Does that actually cause the compiler to use native features when building the kernel? Im only asking because I believe that for the mainline kernel the kbuild build system ignores what is passed into -march on the commandline, and uses the value selected in the Processor Type config entry in the kconfig (so basically Core 2 Duo is the highest feature set you can choose).
                    the output of the command 'ps ax | grep Ofast' during compilation reveals that the kernel is actually being compiled with the cflags -Ofast -march=native
                    Last edited by 4d4c47; 29 February 2016, 03:31 AM.

                    Comment

                    Working...
                    X