Advertisement Jump to content
Sign in to follow this  

Optimise for fastest speed causes crash (VS6)

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

One of the library projects I build to use for my game has a strange problem which has only just appeared. If I build it with optimisation set to "fastest speed" I get an exception thrown and the program crashes when calling D3DXLoadMeshFromXFile (or similar). For other optimisation settings it works fine, and all the other projects in the workspace are building with this optimisation without issue. It only started doing it recently which makes me think it's some new data highlighting the problem. But is this something I can track down, or must I just be happy to use "Smallest Size" or "Default"? What does the Default setting mean anyway - it's not 'off' since there is another setting for that... Thanks.

Share this post

Link to post
Share on other sites
VS has a set of optimization features. Some of them will make your code smaller, some of them will make your code faster. Some of them collide - for example, inlining will (in some cases) make your code run faster, while enlarging it.

"Default" means that the optimizations are balanced somewhere between fastest code and smallest code - according to the knowledge and preference of the VS team.

Regarding your main problem - usually when optimization causes problems, the reason is that you do have a bug, but it's only exposed under optimizations circumstances. The most infamous of these bugs is an uninitialized boolean, for example, that will be "false" if initialized (0) and "true" otherwise (garbage).

I'd do my best to track it down because odds are that you do have a bug. I recommend this roadmap -

1. Set the warning level to 4 and inspect and remove all warnings (except really uninteresting ones such as symbol name truncation for example).
2. Have log messages around the crash spot and check whichever way you can all the paramters of the function and everything leading to them.
3. As a final resort, turn on assembly listing and dive in.

Of course you might have stumbled into a bug in D3DX. Check out their KB to see if anyone has the same problem.

Good luck :-)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!