473,750 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Start Without Debugging(CTRL F5) 3x slower than Start With Debugging(F5)!

This one has me at whit's end.

In order for this to make sense, I will have to lay out the "facts" to
get a hypothesis. There is no easy way to explain this.

Environment: VC2005. MFC Application. Native only.

I compile and link the App.

If I hit CTRL-F5....results 700 ms. (does not recompile or relink)
If I double click in debug folder..700 ms. (does not recompile or
relink)
If I hit F5 (Start With Debugging)...re sult 200 ms. (does not recompile
or relink)

Profiling the code shows that a computationally expensive function
takes 3 times as long if NOT being debugged. Oddly, a function thats
being called from a DLL takes the same amount of time in both
instances. In other words, it is not a uniform slowdown of the App.
So what are some differences between CTRL-F5 and F5?

Working directory for one.

So to make SURE that both are using the same sets of DLLs, I copy all
the DLL's that the debugger loads(shown in output window) into a
temporary directory, and place my app there.

I run the app. Still 700 MS.

What other differences are there between attaching the debugger and NOT
attaching the debugger that could cause this kind of slowdown????

Feb 17 '06 #1
9 3245
Additional Detail:

I have found that the culprit is the _DEBUG preprocessor directive.

As I understand it, _DEBUG causes things to be handled differently at
the CRT level...

Is this perhaps a data alignment issue? I don't want to be
distributing debug builds....

lo***********@y ahoo.com wrote:
This one has me at whit's end.

In order for this to make sense, I will have to lay out the "facts" to
get a hypothesis. There is no easy way to explain this.

Environment: VC2005. MFC Application. Native only.

I compile and link the App.

If I hit CTRL-F5....results 700 ms. (does not recompile or relink)
If I double click in debug folder..700 ms. (does not recompile or
relink)
If I hit F5 (Start With Debugging)...re sult 200 ms. (does not recompile
or relink)

Profiling the code shows that a computationally expensive function
takes 3 times as long if NOT being debugged. Oddly, a function thats
being called from a DLL takes the same amount of time in both
instances. In other words, it is not a uniform slowdown of the App.
So what are some differences between CTRL-F5 and F5?

Working directory for one.

So to make SURE that both are using the same sets of DLLs, I copy all
the DLL's that the debugger loads(shown in output window) into a
temporary directory, and place my app there.

I run the app. Still 700 MS.

What other differences are there between attaching the debugger and NOT
attaching the debugger that could cause this kind of slowdown????


Feb 17 '06 #2
lo***********@y ahoo.com wrote:
Additional Detail:

I have found that the culprit is the _DEBUG preprocessor directive.

As I understand it, _DEBUG causes things to be handled differently at
the CRT level...

Is this perhaps a data alignment issue? I don't want to be
distributing debug builds....

lo***********@y ahoo.com wrote:
This one has me at whit's end.

In order for this to make sense, I will have to lay out the "facts" to
get a hypothesis. There is no easy way to explain this.

Environment : VC2005. MFC Application. Native only.

I compile and link the App.

If I hit CTRL-F5....results 700 ms. (does not recompile or relink)
If I double click in debug folder..700 ms. (does not recompile or
relink)
If I hit F5 (Start With Debugging)...re sult 200 ms. (does not recompile
or relink)

Profiling the code shows that a computationally expensive function
takes 3 times as long if NOT being debugged. Oddly, a function thats
being called from a DLL takes the same amount of time in both
instances. In other words, it is not a uniform slowdown of the App.
So what are some differences between CTRL-F5 and F5?

Working directory for one.

So to make SURE that both are using the same sets of DLLs, I copy all
the DLL's that the debugger loads(shown in output window) into a
temporary directory, and place my app there.

I run the app. Still 700 MS.

What other differences are there between attaching the debugger and NOT
attaching the debugger that could cause this kind of slowdown????


lostnewmexico:

I think you are confusing running under the debugger (versus not) with
debug build versus release build.

In debug build, _DEBUG is always defined, regardless of whether you are
running under the debugger.

In release build, _DEBUG is not defined, and you normally do not run
under the debugger (though you can).

I think you are telling us about speeds of the debug build, with and
without the debugger attached. What you say does surprise me, but
ulimately all that matters is the speed of the release build. I would
hope that it would be faster than the debug build (with or without the
debugger).

David Wilkinson
Feb 17 '06 #3
Thanks for the response David,

I'm not confusing the two...the issues seem to be intertwined.

Check this out:

With _DEBUG defined:

200 MS with or without Debugger attached.

With NDEBUG defined:

200 MS with Debugger attached.
700 MS without Debugger attached.

Feb 17 '06 #4
Thanks for the response David,

I'm not confusing the two...the issues seem to be intertwined.

Check this out:

With _DEBUG defined:

200 MS with or without Debugger attached.

With NDEBUG defined:

200 MS with Debugger attached.
700 MS without Debugger attached.

Feb 17 '06 #5
> Is this perhaps a data alignment issue? I don't want to be
distributing debug builds....

one thing with debug builds: they are built by default to enable buffer
overload detection and extra runtime checking.
For example, if you corrupt your stack in debug build, you get debugger
output messages saying so. I've seen this a few times.
This implies (at least i think it does) that during your program execution,
there is a lot of stuff going on in the background.

when you are ready to release your application, change the configuration to
release. rebuild, and ship the output of the release configuration.
the release configuration will always be faster than the debug builds.
because it will be optimized, and not do all of the debugging stuff.

--

Kind regards,
Bruno.
br************* *********@hotma il.com
Remove only "_nos_pam"
Feb 18 '06 #6
lo***********@y ahoo.com wrote:
Thanks for the response David,

I'm not confusing the two...the issues seem to be intertwined.

Check this out:

With _DEBUG defined:

200 MS with or without Debugger attached.

With NDEBUG defined:

200 MS with Debugger attached.
700 MS without Debugger attached.


Well, there is more difference between debug and release builds than
just _DEBUG and NDEBUG. Optimization level, library versions ... Are
you creating a true release build?

David Wilkinson

Feb 18 '06 #7

David Wilkinson wrote:
lo***********@y ahoo.com wrote:
Thanks for the response David,

I'm not confusing the two...the issues seem to be intertwined.

Check this out:

With _DEBUG defined:

200 MS with or without Debugger attached.

With NDEBUG defined:

200 MS with Debugger attached.
700 MS without Debugger attached.


Well, there is more difference between debug and release builds than
just _DEBUG and NDEBUG. Optimization level, library versions ... Are
you creating a true release build?

David Wilkinson


Thats true David, but the only thing I am changing is the _DEBUG to
NDEBUG for this...Essentia lly, I delted my Release configuration, made
a new Release configuration out of Debug, then flipped things until
this problem reoccured.

The ONLY thing that is different is the _DEBUG to NDEBUG change.

So I guess I need to find out the exact differences between the two.

Feb 18 '06 #8
> Essentially, I delted my Release configuration, made
a new Release configuration out of Debug,


I don't think NDEBUG vs. DEBUG is making the diference. My guess is that you
have some debug build options(s) set in both the release and debug builds. It
could be that the symbol file loads faster or is preloaded when running in
the debugger but is simply unused overhead when not using the debugger.

To really prove it out - try a true release build (e.g. no symbol
generation, optimize for speed, etc.) and then compare that to running under
the debugger vs. outside the debugger.
--
Greg McPherran
www.McPherran.com
Feb 19 '06 #9
In case this could possibly help someone else, I found the problem.

For some reason, when you divide a float by 0, this takes a lot more
time under release than debug to generate or deal with the quiet NAN's.

I

Feb 22 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
1707
by: Noam Raphael | last post by:
Hello, Many times I find myself asking for a slice of a specific length, and writing something like l. This happens both in interactive use and when writing Python programs, where I have to write an expression twice (or use a temporary variable). Wouldn't it be nice if the Python grammar had supported this frequent use? My idea is that the expression above might be expressed as l.
0
1756
by: Dean | last post by:
This is a problem in ASP.NET, when I run an application from Visual Studio (2003) when I do a "start without debugging". The asp page uses objects that I have built in 3 other projects, BusinessObjects, GeneralUtilities, and ASPNETMenu (purchased). Sometime when I will get an error message that says: Parser Error Message: Access is denied: 'ASPnetMenu'. and the aplication will not start. It seems to happen randomly , and it can...
0
1904
by: The Last Danish Pastry | last post by:
A couple of days ago there was a thread "Returning the machine epsilon". The responses in that thread suggested using Double.Epsilon or Single.Epsilon. Since both these seem to return zero I thought I would try to compute these epsilons myself. Using the following program fragment: =================================== private void button4_Click(object sender, System.EventArgs e) { float a; float f= 1.0f;
6
3076
by: mg | last post by:
The following .exe and its parameters work correctly from the command prompt (it prints x.pdf without prompting the user. acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6" "HP LaserJet 3300 Series PCL" "DOT4_001" But, I have not been able to use the exe and its parameters as arguments #1 & #2 in System.Diagnostics.Process.Start( arg1 , arg2) when run in the code behind of a Visual Studio WebForm
0
836
by: Lucas Tam | last post by:
Hello, I'm trying to launch a Windows Form Remoting Server which listens on port 54321 using Process.Start. Process.Start launches the application correctly, but I can't seem to connect to port 54321. I noticed that Process.start launches with the ASPNET account - does the ASPNET account lack the permissions required to listen on non IIS ports?
1
3575
by: Nick Ward | last post by:
Hey, I'm writing an app using C# visual studio express edition. When i run it in debug mode it runs fine and works perfectly, but when i run it without debugging (or from explorer) it crashes and comes up with a "send error report" dialog. Does anyone know why this happens, or how to find out why it is happening? Obviously if it was running in debug mode it would break and show me where the error is but since it isn't, how do i find out?...
3
2137
by: AnalogKid17 | last post by:
I have the following line of code in my start/login page: document.getElementById("txtLogin").focus(); When I run the website app through F5 (Debug, Start Debugging) it works fine (ie, focus on txtLogin). When I run with CTRL+F5 (Debug, Start without debugging) the focus defaults to the URL box. Can anybody unveil the mystery ?
6
6190
by: Bob Rock | last post by:
Hello, I'm using an executable (for which I do not have the source code nor the pdb file) as the startup application to load a DLL I'm writing and need to debug. If I try to debug the DLL I immediately get the error "Unable to start debugging. Unable to start program XXX.exe". If I do "Start without debugging" my startup application gets correctly executed. Is this problem due to the fact I'm missing the debugging information for the...
1
1896
markmcgookin
by: markmcgookin | last post by:
Hi Folks, this is a problem I had a few days ago, and I was able to solve it, but I thought I'd post the solution I found here incase anyone has a similar problem! I found this stuff on an MSNDN forum.
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6803
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.