4 ms·
There's more to optimization than setting -O3. Learning how various compilers behave and how their optimization features interact with your code are valuable sk
by dpe82 13y ago
There's more to optimization than setting -O3. Learning how various compilers behave and how their optimization features interact with your code are valuable skills and may well have been within the scope of the course. Certainly worthy of extra credit.
- scott_karana 13y agoSure, but why not mandate that everyone tunes the same compiler?...
- mikeash 13y agoI'll flip the question around: why mandate it? The class clearly has a performance component, and so students were expected to learn about optimization. Are they going to learn optimization better or worse if you mandate a single compiler? If merely switching compilers is the best path to performance, is that not a valuable lesson? If switching compilers and doing a bunch of extra work to make the code fast with the new compiler is the best path to performance, have they not learned a great deal?
- scott_karana 13y agoSome compilers aren't generally available. Hypothetically, what if ICC wasn't available freely to educational users, but some of the students had side-jobs where they used it? You can always mandate a large set of compilers, make them all available, and leave it up to the students to determine which is fastest. I think that acheives both the competitive/educational goal and the level playing field goal.
- mikeash 13y agoI would definitely ban using any compiler that wasn't generally available to the class, or at least disqualify their output from winning the contest. I'd take a generic approach where it's worded just like that, rather than trying to come up with an official set of acceptable compilers, though.
- scott_karana 13y agoSounds fair enough. I suppose we're really on the same page after all. :)
- mikeash 13y agoSounds good! Just remember, if the Internet Police show up, this never happened.