using gcc 4.6.1 and -flto

Discussion related to the organization of the source code, repository and code-level/compiler optimization.

Moderators: Dade, coordinators

Re: using gcc 4.6.1 and -flto

Postby daidai67 » Fri Aug 12, 2011 9:23 am

hi,

Sorry for the late response, I was very busy with my personal life until recently.

In fact, I used a very simple flags combination, the one which given me the best result (roundly +8%) is:

-O3 (also enable -ftree-vectorize)
-march=native (in this case native=core2, and it will set by default all the -mssex -mfpmath, ... --you don't need to specify them )
-flto
-fwhole-program
-fuse-linker-plugin
-fdata-sections
-ffunction-sections

Nothing more (no -fPIC), nothing less (except the various definition to allow compilation).

For linking, I used the same (-O3, -flto...) + -Wl,--gc-sections. Please note that I have ld.gold installed which give another little boost (in link time also...). I used default toolchain provided by my arch linux 64

Hopes it will help... Maybe the different architecture (intel/amd) behave differently

Regards

ps: I also tested profile guided optimization, but with no gain...
ps2: -ftracer always decreased the performance on my setup...
daidai67
 
Posts: 10
Joined: Wed Dec 31, 2008 2:25 am

Re: using gcc 4.6.1 and -flto

Postby SATtva » Fri Aug 12, 2011 10:21 am

Thank you for the feedback. Will give it a try.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 7164
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: using gcc 4.6.1 and -flto

Postby SATtva » Wed Sep 07, 2011 6:01 am

I've revisited this topic again. And once again without any positive results. This time i closely followed all daidai67's recommendations including list of flags (however i can't use -march=native as my compilation environment is on the different machine than the rendering system) and use of ld.gold, but binaries are still slightly slower than our regular builds. I tend to agree the gain is very architecture specific.

Funny thing -- kernel upgrade to 2.6.39 has given a flat 15% boost to rendering speed without any compile optimizations. :)
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 7164
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Previous

Return to Organization & Optimization

Who is online

Users browsing this forum: No registered users and 1 guest