Performance - System.Web - Comiplation Debug="true"

Posted on 2009-04-30
Last Modified: 2012-05-06
The default web.config for an ASP.NET Web Site has the <compilation debug="true" />.  The web.config warns that leaving this setting on in production is not advised because it impacts performance.

Does anyone know how much of a performance impact this setting incurs?  If it is turned off is there still a way to capture detailed information about where in the code an Exception occurs by logging the Exceptions?




            Set compilation debug="true" to insert debugging 

            symbols into the compiled page. Because this 

            affects performance, set this value to true only 

            during development.


    <compilation debug="true"/>

Open in new window

Question by:ppittle
    LVL 8

    Expert Comment

    i do HealthMonitoring, depending on your app, but you can capture exceptions using try/catch, and then catch them with the health monitoring provider and have it send email or log ot event log or database, or however you want to do it.
    LVL 8

    Author Comment


    Two Questions:
    1)  If <compilation debug="false" /> is set in the web.config, is anything lost from Exception objects when they're captured in a try/catch and logged?  For example, is the stack trace still present?

    2)  Are you aware of any measured data indicating how much of a performance loss is incurred by leaving <compilation debug="false" />?

    LVL 8

    Accepted Solution

    here are a few considerations with debug=true, i would suggest not using it in production

    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.

    There would be coniderable performace from each of these
    LVL 8

    Author Closing Comment

    Thanks for the info.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now