Re: Console.Writeline in release builds a performance issue ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks



"Mark R. Dawson" <MarkRDawson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:35E1FFAE-5DFD-4510-89B2-D3C76CDC2583@xxxxxxxxxxxxxxxx
> An easier way rather than putting lots of #if DEBUG all over your code is
to
> use either the:
>
> System.Diagnostics.Debug.WriteLine or
> System.Diagnostics.Trace.WriteLine methods
>
> When in debug mode both Trace and Debug will output, when in release only
> trace will output, unless you remove the TRACE symbol from you compiler
> options.
>
> Hope that helps.
> Mark R Dawson
> http://www.markdawson.org
>
>
>
>
> "vooose" wrote:
>
> > The short answer is I don't know. But why dont you try looping over 1
> > million times doing Console.Writeline and see how long it takes. If it
> > takes 1 second or less (dont run it under debug mode) then theres really
> > no point going round commenting out all the references in your code.
> >
> > Instead, why not define a DEBUG symbol and only include it in debug
> > builds. eg
> > #if DEBUG
> > Console.Writeline("This is a debug only statement");
> >
> > --
> > Wal
> > http://www.vooose.com
> >
> > *** Sent via Developersdex http://www.developersdex.com ***
> >


.



Relevant Pages

  • Re: 70-316 unsure of the question
    ... Tracing is enabled by default for both Debug and Release builds. ... Trace is enabled by default. ... Change the .config file in the local machine and add an entry for the ...
    (microsoft.public.cert.exam.mcad)
  • Re: [PATCH] RCU: dont turn off lockdep when find suspicious rcu_dereference_check() usage
    ... rcu_dereference_checkwithout protection! ... other info that might help us debug this: ... Call Trace: ...
    (Linux-Kernel)
  • Re: Anyone know how to add a "Debug window" in own app
    ... debug messages in a release build using Trace.WriteLine or Console.WriteLine ... > Because TRACE is defined in Release builds by VS.NET. ... > the people who use your code won't alter the config file? ... > config file will enable the default trace listener.) ...
    (microsoft.public.dotnet.framework)
  • Re: dynamic web page viewer based on url in query sting?
    ... Bob Mixon ... Microsoft SharePoint Portal Server MVP ... I have added trace and debug code to the Web Part so we can see what ... Both the debug and release versions are now available on my Web ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: dynamic web page viewer based on url in query sting?
    ... I have added trace and debug code to the Web Part so we can see what is going on. ... Initially download and install the debug version, it outputs more debug and trace information than the release version does. ... it can be a fully qualified URL or a relative URL; as long as it will properly return a browser page in the Pge Viewer Web Part. ... Microsoft SharePoint Portal Server MVP ...
    (microsoft.public.sharepoint.portalserver.development)