Visual Studio应用程序运行极端慢调试 [英] Visual studio app running extremly slow with debug

查看:303
本文介绍了Visual Studio应用程序运行极端慢调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个原生的c ++程序,当使用Debug(F5)启动时运行速度> 20倍,但在使用无调试启动(Ctrl + F5)时以正常速度运行。

I have a native c++ program which runs > 20 times slower when started with Debug (F5) but runs at normal speed when using start without debug (Ctrl+F5).

无论我使用debug还是release build都没关系。

It does not matter whether I use a debug or release build. Also if I use Windbg the program is a magnitude slower.

有没有一些设置我选择了错误或什么?

Is there some setting I did choose wrong or something?

推荐答案

将_NO_DEBUG_HEAP环境变量设置为1(如 http://preshing.com/20110717/the-windows-heap-is-slow-when-launched-from-the-debugger

Set the _NO_DEBUG_HEAP environment variable to 1 (as seen on http://preshing.com/20110717/the-windows-heap-is-slow-when-launched-from-the-debugger )

这也可以从Visual里面完成。

This can be done from inside Visual, too.

现在这只是一个解决方法,我很想知道如何重构遇到这种问题的程序。你有很多std :: map的,shared_ptr,或任何其他大的indirections任何机会?

Now this is just a workaround, I'm curious to know how to refactor a program which suffers from this kind of problem. Do you have many std::map's, shared_ptr, or any other big indirections by any chance ?

这篇关于Visual Studio应用程序运行极端慢调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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