Articles by Brian Jackson
The Importance of Optimization Flags
3 February 2014
The following is a comment I posted to SMSpower's development forum's concerning a breakthrough in BlameGear's development just a little while ago:
I am livid right now.
For years I've been using gcc and g++ and makefiles, the whole nine yards. I knew you could use -Dwhatever to define preprocessor symbols, -g to enable debugging information, what have you.
But I had never seen the -O2 flag before. In fact, it has nothing to do with raising the oxygen content of your program, as I'd assumed.
You see, gcc and g++ are optimizing compilers (which I was well aware of), but most of that functionality is turned off by default.
I was reading through documentation for a completely unrelated library I was going to use in my dissertation research when I noticed that they'd change from -O3 to -O2 for some platforms.
So I casually googled the optimization flags for g++ and my jaw hit the floor. Frantically, I called my editor forth and traded my usual debug flags for -O2.
My emulator's performance went from 400 max fps to over 1000. I may have already crossed the necessary performance threshold to consider a Raspberry Pi port.
So consider that optimization flags may well be the difference between software that runs like code written by some guy at his house and professional grade performance in the right hands.
That was my lesson today, anyway!
No comments yet...