By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,572 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,572 IT Pros & Developers. It's quick & easy.

ASP.NET performance in debug mode

P: n/a
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
Share this Question
Share on Google+
12 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
<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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.