Alexandre Severino
Alexandre Severino

Reputation: 1613

Optimize only a single method in a Debug configuration

I would like to be able to compile one specific method as if the configuration for optimization was /O2 for "Maximized Speed".

I have tried looking up for the #pragma optimize("", { on, off }) solution, but it doesn't work.

#pragma optimize("", on)
void Mesh::openGL_paint()
{
    // external functions calls with huge overhead when debugging.
}
#pragma optimize("", off)

Upvotes: 0

Views: 103

Answers (1)

MSalters
MSalters

Reputation: 179991

You forgot to include which optimization parameters you want to turn on. And since it's a debug build, there are no command-line defaults to fall back on.

#pragma optimize("gty", on)

Upvotes: 1

Related Questions