Trace perf impact?

  • Thread starter Thread starter Joshua Coady
  • Start date Start date
J

Joshua Coady

Do Trace calls have any impact on performance if Trace is disabled in the
config file?

Josh
 
Joshua,
If you disable Trace in the config file, the call to the Trace methods are
still made, however I suspect each method exits shortly after figuring out
it is turned off in the config file.

If you compile your project without defining the TRACE conditional constant,
then the calls to the Trace methods themselves are not in the compiled code.
You can use the Project Properties to define or not define the TRACE
conditional compilation constant.

Hope this helps
Jay
 
Do you have any data on what the perf impacts are for code that includes
Trace calls but has them disabled in the config? Obviously, if its a game
engine, I would use Debug (or turn Trace of at compile time) and if it's a
win app running on a newer machine I wouldnt care that much about the perf
impacts. But what if it is something in the middle?
 
Joshua,
I don't have any data on the subject, as you say. As you say it depends on
the app.

I would try it both compiled with and without & see. I would think most of
the time you would want to compile with and use the config file to control
it.

The following articles may explain further:
http://msdn.microsoft.com/msdnmag/issues/01/07/vbnet/default.aspx

I want to say there was a 'better' MSDN magazine article on the subject, I'm
just not finding it right now...

Hope this helps
Jay
 
Back
Top