views:

96

answers:

2

Hello,

I want my VC++ code to be executed as fast as possible. Does anybody know what I should change or set in project properties and settings?

+4  A: 

There is no silver bullet. Are you sure you are using data structures and algorithms that are best for your problem? If so, you may want to turn on the compiler optimizations on. Go to Configuration Properties > C/C++ > Optimization and select Maximize Speed / Full Optimization. However, I strongly suggest you play around with all the options in Release mode before settling on any one.

dirkgently
thanks for your reply.there is not any Maximize speed or `full optimization` for me in project properties. there is just `favor size or speed`. I set it on `speed`and it decreased the speed!!! I beleive my structures and algorithms are good enough.can you guide me more please.Thanks
Shadi
Without knowing the problem or looking at any code or design it is impossible to suggest anything. Which version of VS are you using? Start using a profiler to meausre the hotspots.
dirkgently
I am using Visual studio .NET 2008.
Shadi
+1  A: 

When you believe your structures and algorithms are good enough, it is very likely that they have a lot of room for improvement. To optimize that, in a Debug build, optimize in this way. Here's an example of this process.

Then switch to release mode, and it should generate the proper compiler optimizations.

Mike Dunlavey