即使在发布时,我的C ++可执行文件在Visual Studio 2008 IDE之外的运行速度比内部运行的要快 [英] My C++ executable runs way faster outside the Visual Studio 2008 IDE than inside, even in release

查看:95
本文介绍了即使在发布时,我的C ++可执行文件在Visual Studio 2008 IDE之外的运行速度比内部运行的要快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个C ++应用程序,进行一些数字的处理。
我正在Visual Studio 2008 PRO SP1中运行,在发行模式下,Windows 7 64位。
如果我在IDE中运行它,应用程序需要4分钟,如果我从Windows资源管理器运行相同的可执行文件需要6秒!
我没有线索。我已经检查这不依赖于处理器和操作系统。我不认为我有奇怪的VS插件在后台做某事。



任何提示?
提前谢谢!



Marco

解决方案

推测,当您在Visual Studio中启动应用程序时,调试器被附加时引起的速度减慢。即使您在发布模式下构建程序也是如此。



为了确认这确实是您问题的根源,请尝试运行您的应用程序,而不需要调试器,使用开始不调试命令或 Ctrl + F5



    ;



C ++具体来说,当你开始没有调试,你的程序将不会使用Windows调试堆。随着调试器的附加,它将。


I build a C++ application that does some number crunching. I'm running in Visual Studio 2008 PRO SP1, in release mode, Windows 7 64 bit. If I run it inside the IDE, the application takes 4 minutes, if I run the same executable from windows explorer it takes 6 seconds! I have no clue. I have checked that this does not depend on the processor and operating system. I don't think I have strange VS plugins that are doing something in the background.

Any hints? Thank you in advance!

Marco

解决方案

Presumably, the slow down is caused by the debugger being attached when you are starting the application in Visual Studio. This is the case even when you've built the program in "Release" mode.

To confirm that this is indeed the source of your problem, try running your application without the debugger, using the "Start Without Debugging" command or Ctrl+F5.

   

It's worth nothing that in C++ specifically, when you start without debugging, your program won't use the Windows debug heap. With the debugger attached, it will.

这篇关于即使在发布时,我的C ++可执行文件在Visual Studio 2008 IDE之外的运行速度比内部运行的要快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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