如何使MSVC调试版本运行更快 [英] How to make MSVC debug builds run faster

查看:333
本文介绍了如何使MSVC调试版本运行更快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个大型的C ++应用程序,有时我们需要运行作为调试构建,以调查错误。调试生成比发布版本慢得多,几乎无法使用。

We have a large C++ application, which sometimes we need to run as a debug build in order to investigate bugs. The debug build is much much slower than the release build, to the point of being almost unusable.

有什么技巧可以使MSVC Debug生成更快执行,而不会牺牲太多关于可调试性?

What tricks are available for making MSVC Debug builds execute faster without sacrificing too much on the debugability?

推荐答案

使用 #pragma optimize(,off)在您想要在发布中调试的选定文件的顶部。这会产生更好的堆栈跟踪/变量视图。

Use #pragma optimize("", off) at the top of selected files that you want to debug in release. This gives better stack trace/variable view.

如果只有几个文件需要追踪该bug,那么效果很好。

Works well if it's only a few files you need to chase the bug in.

这篇关于如何使MSVC调试版本运行更快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆