473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP.NET performance in debug mode

All the documentation says that leaving an ASP.NET application in debug
mode has a big performance hit. I can't detect any difference between
debug and non-debug modes. Am I missing something or is the
documentation wrong?
I've been load testing an ASP.NET website (built in VS.NET 2003 in C#).
I've used the ACT to generate heavy loads over several minutes. Debug
or no debug produces almost identical performance results.
To ensure I'm really in non-debug mode I have:
1) rebuilt the solution (for all my included C# DLLs) in "release"
mode.
2) changed to debug="false" in web.config.
Is there something else to turn off debugging and get lots more
performance from my site?

Nov 19 '05 #1
12 3384
Apart from enhancing protection and security, release mode also contributes
to the size-reduction of MSIL files
Extra NOP IL instructions are excluded.

Regards,
Jignesh Desai.
<no****@odysseyzone.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
All the documentation says that leaving an ASP.NET application in debug
mode has a big performance hit. I can't detect any difference between
debug and non-debug modes. Am I missing something or is the
documentation wrong?
I've been load testing an ASP.NET website (built in VS.NET 2003 in C#).
I've used the ACT to generate heavy loads over several minutes. Debug
or no debug produces almost identical performance results.
To ensure I'm really in non-debug mode I have:
1) rebuilt the solution (for all my included C# DLLs) in "release"
mode.
2) changed to debug="false" in web.config.
Is there something else to turn off debugging and get lots more
performance from my site?

Nov 19 '05 #2
cic
Yes - I can see the non-debug offers some marginal inprovements i.e. a
couple of percent smaller DLLs and extra speed. However the
documantation says there is a big perfromance hit. Unless I'm missing
something the documentation is wrong.

This would mean that I can leave in the symbol tables so I get nice
code-bug messages. Also I can leave on debug mode to watch my live
servers - all without any significant performance hit. Both are very
useful thing to do.
As anyone else benchmarked debug mode vs. non debug mode?

Nov 19 '05 #3
This biggest problem with debug mode is that pages do not timeout. If
for some reason a request gets into trouble and is just spinning and
waiting for a database query or webservice call to return, then
requests start to queue and rejected.

You can always build and deploy symbol files in release mode.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 10 Dec 2004 05:36:22 -0800, "cic" <no****@odysseyzone.com> wrote:
Yes - I can see the non-debug offers some marginal inprovements i.e. a
couple of percent smaller DLLs and extra speed. However the
documantation says there is a big perfromance hit. Unless I'm missing
something the documentation is wrong.

This would mean that I can leave in the symbol tables so I get nice
code-bug messages. Also I can leave on debug mode to watch my live
servers - all without any significant performance hit. Both are very
useful thing to do.
As anyone else benchmarked debug mode vs. non debug mode?


Nov 19 '05 #4
the performance gain of release mode vs debug mode depend on the performance
characteristics of the application. asp.net apps are usually very database
and string manipulation orientated. these will see little performance gain.
also in an asp.net app the amount of user code to framework code is usually
a small percent. however a numerial analaysis, or bitmap manipulation
application (loops with thousands of iterations) will see a greater gain.

-- bruce (sqlwork.com)
<no****@odysseyzone.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
| All the documentation says that leaving an ASP.NET application in debug
| mode has a big performance hit. I can't detect any difference between
| debug and non-debug modes. Am I missing something or is the
| documentation wrong?
|
|
| I've been load testing an ASP.NET website (built in VS.NET 2003 in C#).
| I've used the ACT to generate heavy loads over several minutes. Debug
| or no debug produces almost identical performance results.
|
|
| To ensure I'm really in non-debug mode I have:
| 1) rebuilt the solution (for all my included C# DLLs) in "release"
| mode.
| 2) changed to debug="false" in web.config.
|
|
| Is there something else to turn off debugging and get lots more
| performance from my site?
|
Nov 19 '05 #5
<no****@odysseyzone.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
All the documentation says that leaving an ASP.NET application in debug
mode has a big performance hit.


Can you point me to some documentation that says this? I don't remember ever
seeing it.

John Saunders
Nov 19 '05 #6
re:
Can you point me to some documentation that says this?
I don't remember ever seeing it.
http://samples.gotdotnet.com/quickst...erftuning.aspx

15. Do not forget to disable Debug mode: The <compilation> section
in ASP.NET configuration controls whether an application is compiled
in Debug mode, or not.

Debug mode degrades performance significantly. Always remember
to disable Debug mode before you deploy a production application
or measure performance.


Juan T. Llibre
===========
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... <no****@odysseyzone.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
All the documentation says that leaving an ASP.NET application in debug
mode has a big performance hit.


Can you point me to some documentation that says this? I don't remember
ever seeing it.

John Saunders


Nov 19 '05 #7
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
re:
Can you point me to some documentation that says this?
I don't remember ever seeing it.


http://samples.gotdotnet.com/quickst...erftuning.aspx

15. Do not forget to disable Debug mode: The <compilation> section
in ASP.NET configuration controls whether an application is compiled
in Debug mode, or not.

Debug mode degrades performance significantly. Always remember
to disable Debug mode before you deploy a production application
or measure performance.


Thanks. I see there's a language issue. "significantly" != "big hit" to me.

John Saunders
Nov 19 '05 #8
Hi, John.

There's a bit more information at
http://msdn.microsoft.com/library/de...netchapt06.asp
and it sheds a bit more light on this.

---000---
Ensure Debug Is Set to False

When debug is set to true, the following occurs:

Pages are not batch compiled.

Pages do not time out.
When a problem occurs, such as a problem with a Web service call,
the Web server may start to queue requests and stop responding.

Additional files are generated in the Temporary ASP.NET Files folder.

The System.Diagnostics.DebuggableAttribute attribute is added to
generated code. This causes the CLR to track extra information
about generated code, and it also disables certain optimizations.

Before you run performance tests and before you move your
application into production, be sure that debug is set to false
in the Web.config file and at the page level.

By default, debug is set to false at the page level. If you do need
to set this attribute during development time, it is recommended
that you set it at the Web.config file level, as follows :

<compilation debug="false" ... />

The following shows how to set debug to false at the page level.

<%@ Page debug="false" ... %>

Note A common pitfall is to set this attribute at the page level
during development and then forget to set it back when the
application is moved to production.

---000---

A good way to establish whether there's a "degradation",
or a "big hit", is to build a Debug version and a Release version
of any application and profile both with the Web Application Stress Tool :

http://support.microsoft.com/default...b;en-us;815161

Download the WAST from:
http://www.microsoft.com/downloads/d...displaylang=en

WAST does run on Windows Server 2003 *and* Windows XP,
even though they are not mentioned in that page.

The IIS Resource Kit Tools also has a neat tool called the
"Web Capacity Analysis Tool" (Version 5.2) which can also
be used to see how much of a performance hit exists in Debug
versions of ASP.NET apps, compared to Release versions.

Get it at :
http://www.microsoft.com/downloads/d...DisplayLang=en

Juan T. Llibre
===========
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:OP**************@TK2MSFTNGP14.phx.gbl...
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
re:
Can you point me to some documentation that says this?
I don't remember ever seeing it.


http://samples.gotdotnet.com/quickst...erftuning.aspx

15. Do not forget to disable Debug mode: The <compilation> section
in ASP.NET configuration controls whether an application is compiled
in Debug mode, or not.

Debug mode degrades performance significantly. Always remember
to disable Debug mode before you deploy a production application
or measure performance.


Thanks. I see there's a language issue. "significantly" != "big hit" to
me.

John Saunders


Nov 19 '05 #9
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:ek****************@TK2MSFTNGP12.phx.gbl...
Hi, John.

There's a bit more information at
http://msdn.microsoft.com/library/de...netchapt06.asp
and it sheds a bit more light on this.


....

Thanks a lot for all of the info.

I wonder if you have any performance numbers, or if one of those articles
has any. I'm interested to know if the performance hit is as much as 5%
(once all the pages have been compiled).

John Saunders
Nov 19 '05 #10
cic
My figures show less than 5% hit. Small timings are harder to measure
but I would say about 2 to 3%. This is for an application with a lot of
processing and moderated database use i.e. the .NET code is a
reasonable chunk of the time taken to service each hit.

I know this all comes down to definitions. Agreed that "significant"
isn't neccessarily "big". However "significant" would be more than
(say) 5% timing improvement. I doubt an end user would notice less
than 5% - thefore not "significant". Please forgive my initial sloppy
use of language.

Nov 19 '05 #11
cic
Thanks for all the replies on this. I think in summary:

1) Building .NET code with debug symbol tables has a slight performance
hit (extra NOPs) but probably not enough to outway the benefits of
having good crash messages when things go wrong unless you write fully
bug free code ;-)

2) Running ASP.NET in debug="true" mode is not such a good idea in
production. The main reason is not performance as measured by normal
load testing - but in the way ASP.NET treats processes in debug mode -
the main one being no timeout on runaway requests. However - to switch
debug on for short periods when you do want to debug a live site will
not create too many problem - just remember to switch it off again
later.

Is that a fair summary?

Nov 19 '05 #12
cic
I know this all comes down to definitions. Agreed that "significant"
isn't neccessarily "big". However "significant" would be more than
2-3% timing improvement. I doubt an end user would notice 2-3% -
thefore not "significant". Please forgive my initial sloppy use of
language.

Nov 19 '05 #13

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

Similar topics

12
by: Dave Theese | last post by:
Hello all, I'm in a poition of trying to justify use of the STL from a performance perspective. As a starting point, can anyone cite any benchmarks comparing vectors to plain old...
4
by: steve | last post by:
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the performance is not good as I...
2
by: johdi | last post by:
Hey there, This is no doubt demonstrating how cruddy my understanding is - what are the performance implications of having left the Debug=true value in your web.config file but not...
3
by: Andrew Jocelyn | last post by:
Hi I have a simple ASP.NET web page with a single label control: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="proj.TheTime" EnableViewState="false"...
5
by: Sagaert Johan | last post by:
Hi Can a lot of Console.Writeline commands cause a program to run slower ? johan
9
by: Marty | last post by:
Hi, Does using the the conditional operator (?:) instead of the common "if" statement will give a performance gain in a C# .NET 2003 application (even in C# .NET 2005?). What is the advantage...
1
by: Jon | last post by:
Hello, I have 3 asp.net dll's that are on my host in debug mode, now, the runtime ones won't work, I know the reason why. But i just wanted to know if there#ll be much of a performance...
8
by: SzH | last post by:
I would like to read in large integer matrices from text files, as quickly as possible. I did a naive implementation (see below), but for an input file with 100 rows and 250000 columns it runs...
12
by: Ilyas | last post by:
Hi all I have an application which brings back 1000 records from a sql server database. Under the local asp.net development server provided with Visual Studio 2008, it takes about 1.8 seconds ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.