I have gotten interested in chess engine programming. I have downloaded both Code::Blocks with MinGW and Visual C++ Express 2010 and have noticed a difference in the speed and strength of the same chess engine when compiled using these different IDEs. Can anyone explain why this happens?
Compiler optimizations are different for different compilers. C++ code doesn't get "literally" translated to machine code. There are a lot of optimizations the compiler does behind the scenes.
This was with the defaults for both. I have since been playing around with the optimization settings for both and I must say that I have had more promising results with CodeBlocks. I so far have not had allot of success optimizing VC Express. Any time I select an optimization setting I get an error/conflict with the debugger or some other settings.
Optimizing CodeBlocks has much more successful and as a result the compiled code has performed even better than the code compiled with VC Express.
What all needs to change in VC Express to achieve similar optimization as the g++ -O3 settings?
Right on the toolbar there's a drop-list that says "Debug" in it. Just change that to "Release". That changes the current configuration. Then you can tweak all the optimization settings and rebuild.