Optimizing

  • Thread starter Thread starter Jeff Collett
  • Start date Start date
J

Jeff Collett

Hi,
I have an app that compiles and works fine in Debug mode. However, when
I try it in Release, it compiles fine but does not run correctly. I am
thinking that it is an optimization problem.
I have not been able to figure out how to deal with that in .NET 2003.
Anyone know how and if it is possible to reduce or turn off
optimizations?

Thanks
Jeff
 
Hi,

Right-click on the project in Solution Explorer and choose 'Properties'.
Depending on what language you're using you'll find the optimization
settings somewhere within (for example, C++ has settings under the compiler
options and the linker options. Your best bet is probably turning things off
one by one. If you've altered the settings in the Debug build, they won't
automatically become part of the Release build, so it's worth checking that
any important settings (for example, RTTI in C++) have been migrated to the
other build targets. Good luck!

Steve
 
Jeff Collett said:
I have an app that compiles and works fine in Debug mode. However, when
I try it in Release, it compiles fine but does not run correctly. I am
thinking that it is an optimization problem.
I have not been able to figure out how to deal with that in .NET 2003.
Anyone know how and if it is possible to reduce or turn off
optimizations?

It's more likely that it's a problem in your code which just happens
not to show up when running in the debugger. Various things
(particularly involving threading) can do this. In what way does your
app not run correctly in release mode?
 
I have an application that does serial communication and then displays a
list of items based on what was returned on the serial port. The List
will not display in release.
When I go to check the optimization, under C/C++/ Optimization, most of
the choices there are dimmed out.
The bottom 3 can be changed, current settings are
Enable Fiber-Safe Optimizations No
Optimize For Processor Blended
Optimize For Windows Application No

Other than those three I cannot change anything.

I am also going through the code to see if there could be something
else.

Thanks
 
Do you have VS Professional or VC++ Standard Ed? The standard edition
doesn't come with the optimising compiler (GRRR!) which may be why these
options are greyed out. It should print out which compiler version you're
using at the top of the build log. If it's not being optimised, find out
exactly which settings (both compiler and linker) are different between the
two builds.

Other than that, like Jon said, threading can become a big problem in
release builds, and this might apply to serial comms. You might consider
building a debuggable release build. Have a look at
http://www.cygnus-software.com/papers/release_debugging.html and there's
also something on MSDN about it but I can't find it.

Steve
 
Hi,
It is the Standard version. I will look over that article, maybe that
will help. A lack of being able to use breakpoints does make it a bit
difficult to track down.

Thanks
Jeff
 
Back
Top