My C ++ executable runs faster outside of Visual Studio 2008 than inside, even in release

I am creating a C ++ application that does a crunch. I work 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 idea. I checked that this is processor and operating system independent. I don’t think I have weird VS plugins that do something in the background.

Any clues? Thank you in advance!

Marco

+4
source share
2 answers

Presumably, the slowdown is due to the fact that the debugger is connected when the application starts in Visual Studio. This happens even when you created the program in "Release" mode.

To make sure that this is really the source of your problem, try starting the application without a debugger using the command "Start without debugging" or Ctrl + F5 .

Start without debugging

There is nothing special in C ++ when you start without debugging, your program will not use a bunch of Windows debugging. With an attached debugger it will be.

+11
source

As Cody mentioned, one option is simply not debugging. But if you want to speed up debugging sessions, here are a few things I found can make a huge difference:

  • Delete print debug statements that are no longer needed. If you see that your journal is filled with text, this can slow you down significantly.
  • Delete breakpoints ( Ctrl + Shift + F5 ). A couple of times I noticed a huge drop in performance, and it turned out that this was due to a breakpoint with a condition that was never met.
0
source

Source: https://habr.com/ru/post/1334524/


All Articles