Visual Studio应用程序运行极端慢调试

编程入门 行业动态 更新时间:2024-10-28 14:31:12
本文介绍了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(如 preshing/20110717/the-windows-heap-is-slow-when-launched-from-the-debugger )

Set the _NO_DEBUG_HEAP environment variable to 1 (as seen on preshing/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应用程序运行极端慢调试

本文发布于:2023-11-15 21:09:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1597976.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!