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

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

问题描述

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

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

推荐答案

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

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.

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

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.

   ;

   

这不值得C ++专门,当你开始而不调试,你的程序将不会使用Windows调试堆。附加调试器,它将。

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天全站免登陆