Announcement

Collapse
No announcement yet.

GCC Benchmarks At Varying Optimization Levels With Core i9 10900K Show An Unexpected Surprise

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

  • GCC Benchmarks At Varying Optimization Levels With Core i9 10900K Show An Unexpected Surprise

    Phoronix: GCC Benchmarks At Varying Optimization Levels With Core i9 10900K Show An Unexpected Surprise

    With the Intel Core i9 10900K "Comet Lake" processor here are some fresh GCC compiler benchmarks when looking at the performance of GCC 8.4 versus 9.3 versus a 10.2 snapshot while testing with optimization flags of -O2, -O3 -march=native, and -O3 -march=native -flto.

    http://www.phoronix.com/vr.php?view=29417

  • #2
    Thank you! Your work in helping keep the linux ecosystem blazing fast is much appreciated.

    Comment


    • #3
      Is it possible to use your automated test infrastructure to run a git bisect to see what range of commits introduced these regressions?

      Comment


      • #4
        Can you check if Ryzen is similarly affected?

        Comment


        • #5
          Originally posted by signbit View Post
          Is it possible to use your automated test infrastructure to run a git bisect to see what range of commits introduced these regressions?
          Yes but rather time consuming for a codebase as large as GCC thus unfortunately not justifiable unless there are people providing tips or the like to justify.
          Michael Larabel
          http://www.michaellarabel.com/

          Comment


          • #6
            Could you please supply a run with O2 march=native as well?
            Gentoo for instance recommends running no higher than O2 (for system wide settings), but everybody runs with march=native.

            Comment


            • #7
              Ha, you wrote "surprise" in the title, I opened the article hoping there's a "pleasant" to go with it.

              Comment


              • #8
                So, -O2 was run without -march=native, while -O3 used the option.

                Sorry, Michael , it's hard to take your results seriously. Please retest while giving all the optimization levels comparable compilation flags.

                Without -march=native GCC optimizes the code for the generic oldest x86-64 CPU which is Athlon 64 from over 15 years ago. Quite expectedly the extended instruction set is not being used.

                Comment


                • #9
                  Originally posted by birdie View Post
                  So, -O2 was run without -march=native, while -O3 used the option.

                  Sorry, Michael , it's hard to take your results seriously. Please retest while giving all the optimization levels comparable compilation flags.

                  Without -march=native GCC optimizes the code for the generic oldest x86-64 CPU which is Athlon 64 from over 15 years ago. Quite expectedly the extended instruction set is not being used.
                  Because many distributions and others just do "-O2" without "-march=native" which is why that level was tested that way.
                  Michael Larabel
                  http://www.michaellarabel.com/

                  Comment


                  • #10
                    Here's a very long list of differences between -O2 -march=x86-64 and -O2 -march=native for my Ryzen 7 3700X:

                    Code:
                    diff -u O2-opts O2-opts-native
                    --- O2-opts    2020-07-27 15:14:14.859498803 +0000
                    +++ O2-opts-native    2020-07-27 15:14:28.246384710 +0000
                    @@ -9,11 +9,11 @@
                       -m8bit-idiv                         [disabled]
                       -m96bit-long-double                 [enabled]
                       -mabi=                              sysv
                    -  -mabm                               [disabled]
                    +  -mabm                               [enabled]
                       -maccumulate-outgoing-args          [disabled]
                       -maddress-mode=                     short
                    -  -madx                               [disabled]
                    -  -maes                               [disabled]
                    +  -madx                               [enabled]
                    +  -maes                               [enabled]
                       -malign-data=                       compat
                       -malign-double                      [disabled]
                       -malign-functions=                  0
                    @@ -21,10 +21,10 @@
                       -malign-loops=                      0
                       -malign-stringops                   [enabled]
                       -mandroid                           [disabled]
                    -  -march=                             x86-64
                    +  -march=                             znver2
                       -masm=                              att
                    -  -mavx                               [disabled]
                    -  -mavx2                              [disabled]
                    +  -mavx                               [enabled]
                    +  -mavx2                              [enabled]
                       -mavx256-split-unaligned-load     [disabled]
                       -mavx256-split-unaligned-store     [disabled]
                       -mavx5124fmaps                      [disabled]
                    @@ -45,38 +45,38 @@
                       -mavx512vp2intersect                [disabled]
                       -mavx512vpopcntdq                   [disabled]
                       -mbionic                            [disabled]
                    -  -mbmi                               [disabled]
                    -  -mbmi2                              [disabled]
                    +  -mbmi                               [enabled]
                    +  -mbmi2                              [enabled]
                       -mbranch-cost=<0,5>                 0
                       -mcall-ms2sysv-xlogues              [disabled]
                       -mcet-switch                        [disabled]
                       -mcld                               [disabled]
                       -mcldemote                          [disabled]
                    -  -mclflushopt                        [disabled]
                    -  -mclwb                              [disabled]
                    -  -mclzero                            [disabled]
                    +  -mclflushopt                        [enabled]
                    +  -mclwb                              [enabled]
                    +  -mclzero                            [enabled]
                       -mcmodel=                           32
                       -mcpu=                             
                       -mcrc32                             [disabled]
                    -  -mcx16                              [disabled]
                    +  -mcx16                              [enabled]
                       -mdispatch-scheduler                [disabled]
                       -mdump-tune-features                [disabled]
                       -menqcmd                            [disabled]
                    -  -mf16c                              [disabled]
                    +  -mf16c                              [enabled]
                       -mfancy-math-387                    [enabled]
                       -mfentry                            [disabled]
                       -mfentry-name=                     
                       -mfentry-section=                  
                    -  -mfma                               [disabled]
                    +  -mfma                               [enabled]
                       -mfma4                              [disabled]
                       -mforce-drap                        [disabled]
                       -mforce-indirect-call               [disabled]
                       -mfp-ret-in-387                     [enabled]
                       -mfpmath=                           387
                    -  -mfsgsbase                          [disabled]
                    +  -mfsgsbase                          [enabled]
                       -mfunction-return=                  keep
                       -mfused-madd                        -ffp-contract=fast
                    -  -mfxsr                              [disabled]
                    +  -mfxsr                              [enabled]
                       -mgeneral-regs-only                 [disabled]
                       -mgfni                              [disabled]
                       -mglibc                             [enabled]
                    @@ -96,45 +96,45 @@
                       -mlong-double-64                    [disabled]
                       -mlong-double-80                    [enabled]
                       -mlwp                               [disabled]
                    -  -mlzcnt                             [disabled]
                    +  -mlzcnt                             [enabled]
                       -mmanual-endbr                      [disabled]
                       -mmemcpy-strategy=                 
                       -mmemset-strategy=                 
                       -mmitigate-rop                      [disabled]
                    -  -mmmx                               [disabled]
                    -  -mmovbe                             [disabled]
                    +  -mmmx                               [enabled]
                    +  -mmovbe                             [enabled]
                       -mmovdir64b                         [disabled]
                       -mmovdiri                           [disabled]
                       -mmpx                               [disabled]
                       -mms-bitfields                      [disabled]
                       -mmusl                              [disabled]
                    -  -mmwaitx                            [disabled]
                    +  -mmwaitx                            [enabled]
                       -mno-align-stringops                [disabled]
                       -mno-default                        [disabled]
                       -mno-fancy-math-387                 [disabled]
                       -mno-push-args                      [disabled]
                       -mno-red-zone                       [disabled]
                    -  -mno-sse4                           [enabled]
                    +  -mno-sse4                           [disabled]
                       -mnop-mcount                        [disabled]
                       -momit-leaf-frame-pointer           [disabled]
                       -mpc32                              [disabled]
                       -mpc64                              [disabled]
                       -mpc80                              [disabled]
                    -  -mpclmul                            [disabled]
                    +  -mpclmul                            [enabled]
                       -mpcommit                           [disabled]
                       -mpconfig                           [disabled]
                       -mpku                               [disabled]
                    -  -mpopcnt                            [disabled]
                    +  -mpopcnt                            [enabled]
                       -mprefer-avx128                     -mprefer-vector-width=128
                       -mprefer-vector-width=              none
                       -mpreferred-stack-boundary=         0
                       -mprefetchwt1                       [disabled]
                    -  -mprfchw                            [disabled]
                    +  -mprfchw                            [enabled]
                       -mptwrite                           [disabled]
                       -mpush-args                         [enabled]
                    -  -mrdpid                             [disabled]
                    -  -mrdrnd                             [disabled]
                    -  -mrdseed                            [disabled]
                    +  -mrdpid                             [enabled]
                    +  -mrdrnd                             [enabled]
                    +  -mrdseed                            [enabled]
                       -mrecip                             [disabled]
                       -mrecip=                           
                       -mrecord-mcount                     [disabled]
                    @@ -143,23 +143,23 @@
                       -mregparm=                          0
                       -mrtd                               [disabled]
                       -mrtm                               [disabled]
                    -  -msahf                              [disabled]
                    +  -msahf                              [enabled]
                       -msgx                               [disabled]
                    -  -msha                               [disabled]
                    +  -msha                               [enabled]
                       -mshstk                             [disabled]
                       -mskip-rax-setup                    [disabled]
                       -msoft-float                        [disabled]
                    -  -msse                               [disabled]
                    -  -msse2                              [disabled]
                    +  -msse                               [enabled]
                    +  -msse2                              [enabled]
                       -msse2avx                           [disabled]
                    -  -msse3                              [disabled]
                    -  -msse4                              [disabled]
                    -  -msse4.1                            [disabled]
                    -  -msse4.2                            [disabled]
                    -  -msse4a                             [disabled]
                    +  -msse3                              [enabled]
                    +  -msse4                              [enabled]
                    +  -msse4.1                            [enabled]
                    +  -msse4.2                            [enabled]
                    +  -msse4a                             [enabled]
                       -msse5                              -mavx
                       -msseregparm                        [disabled]
                    -  -mssse3                             [disabled]
                    +  -mssse3                             [enabled]
                       -mstack-arg-probe                   [disabled]
                       -mstack-protector-guard-offset=    
                       -mstack-protector-guard-reg=        
                    @@ -172,7 +172,7 @@
                       -mtls-dialect=                      gnu
                       -mtls-direct-seg-refs               [enabled]
                       -mtune-ctrl=                       
                    -  -mtune=                             generic
                    +  -mtune=                             znver2
                       -muclibc                            [disabled]
                       -mvaes                              [disabled]
                       -mveclibabi=                        [default]
                    @@ -180,13 +180,13 @@
                       -mvpclmulqdq                        [disabled]
                       -mvzeroupper                        [disabled]
                       -mwaitpkg                           [disabled]
                    -  -mwbnoinvd                          [disabled]
                    +  -mwbnoinvd                          [enabled]
                       -mx32                               [disabled]
                       -mxop                               [disabled]
                    -  -mxsave                             [disabled]
                    -  -mxsavec                            [disabled]
                    -  -mxsaveopt                          [disabled]
                    -  -mxsaves                            [disabled]
                    +  -mxsave                             [enabled]
                    +  -mxsavec                            [enabled]
                    +  -mxsaveopt                          [enabled]
                    +  -mxsaves                            [enabled]

                    Comment

                    Working...
                    X