Best Compiler Options

Started by
4 comments, last by cignox1 19 years, 1 month ago
i am currently reading NeHes OpenGL Tuts and coding some small OpenGL stuff, but when i compile my code or the code from the tuts i get an programm what is significant slower than the binarys that came with the tuts i tried it on MS VC++ 6.0 and DevCPP 4 i turned debuging information and exception handling off and tried some optimizations, but still its damm slow does anybody know how to configure one of the above compilers to make better code? ------------------------------------------------------------------------------- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan
-------------------------------------------------------------------"Debugging is twice as hard as writing the code in the first place.Therefore, if you write the code as cleverly as possible, you are,by definition, not smart enough to debug it." - Brian W. Kernighan
Advertisement
Are you sure to have Dev-C++ 4? Isn't it version 5 (4.9.9.2) ? If not then try downloading the latest versione of Dev-C++. For VC++ what optimization parameters did you set?
Quote:does anybody know how to configure one of the above compilers to make better code?
For Dev-C++, -Werror -pedantic. Anyone know the MS equivalent to these?
Free Mac Mini (I know, I'm a tool)
thanks i try Dev Cpp 5 with these options

>For VC++ what optimization parameters did you set?
i optimized it to Maximize Speed but the performance gain was not that great
-------------------------------------------------------------------"Debugging is twice as hard as writing the code in the first place.Therefore, if you write the code as cleverly as possible, you are,by definition, not smart enough to debug it." - Brian W. Kernighan
Visual C++ 6.0 is quite outdated. I'd suggest upgrading soon (though you might want to wait for the 2005 ver to be released, you can use the beta of it now with some restrictions)
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
VisualC++ 6 is very outdated, IIRC it has optimization setups up to pentium pro. But you should be able to see some differences (it depends by the code, but I guess at least 20-50%, perhaps more, that is not bad). If you hope to have a 10x speed incrase, the only way is to find some algorithms that can be rewritten with a better complexity order (like switching from InsertSort to QuickSort for 1000000 elements).
As an example, a test of my raytracer (not so optimized, 'cause I'm not a smart optimizer), need more or less 0.55s when not optimized, but only 0.2s when optimized (using Dev-C++ optimization options). A speedup of more than 2x. I'm pretty satisfied.

This topic is closed to new replies.

Advertisement