Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what flags will improve gcc/clang compile times?

What flags for either gcc or clang will improve compile times? I require debugging to be enabled but any other features are free to be disabled if they will result in faster compiles.

I know there are numerous other ways to improve compile times but I am interested soley in this area.

like image 544
jonr Avatar asked Jan 05 '12 21:01

jonr


1 Answers

The largest gain in compile time is found by eliminating the most work done by the compiler - usually optimisation. So, don't enable optimisation (-O) flags.

like image 138
Greg Hewgill Avatar answered Sep 17 '22 22:09

Greg Hewgill