Recode Deoptimize

Recode supports enabling and disabling compiler optimizations at runtime. This is very useful for cases where you need to diagnose issues with optimised builds. In particular it allows you to watch local stack variables and step into inline functions that would otherwise be optimized away by the compiler.

What Does Deoptimize Do?

Deoptimizing a file is the equivalent of setting these compiler options:

  • /Od - Disable optimizations.
  • /Ob0 - Disables inline function expansion.

Using Recode Deoptimize


Deoptimization can only be applied once the debug session has started. You cannot deoptimize any files before the debug session has begun.

To deoptimize a file, right click the code window of the file you wish to deoptimize and select Deoptimize for Recode. The Deoptimize for Recode menu item is a toggle allowing you to see the current state for the selected source file.

When you have applied Deoptimize for Recode to all the source files you wish to deoptimize use the Recode button to apply the deoptimization. Once applied, stepping through the code in a deoptimized file will give you access to full debug information and inline function calls.

When you have finished debugging the deoptimized files, you can toggle ``Deoptimize for Recode``to enable optimisations once again. This can be useful for extremely performance critical code but is rarely needed in practice.