GNUC Makefile missing optimizations

Started by
2 comments, last by rkliewer 2 weeks, 1 day ago

I observed some benchmarks that felt like they were slower than they really should have been. After verifying I was following best practices in the fine tuning section of the docs, I examined the gnuc makefile and noticed no optimizations were being performed. After I added -O2 optimizations, I saw significant improvement in a fibonacci test (about 3x) and a script side implementation of findFirstNotOf (2x) on a very large string.

The other builds contain compiler optimizations, so I am assuming the gnuc makefile was just an oversight. I recommend adding -O2 to the compiler flags for gnuc or if the exclusion was intentional, at least leave a TODO/FIXME comment highlighting this fact.

Advertisement

Good point. I'll add the TODO

I haven't added the -O2 flag by default because I often test at different optimization levels so I make this an input by setting the CXXFLAGS env variable before running make.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Sounds good, that should make it obvious to anyone poking around in the Makefile. Thanks.

Advertisement