I found this in some production login code I was looking at recently...
HttpContext.Current.Trace.Write(query + ": " + username + ", " + password));
...where query is a short SQL query to grab matching users. Does this have any sort of performance impact? I assume its very small.
Also, what is the purpose of this exact type of trace, using the HTTP Context? Where does this data get traced to? Thanks in advance!
Yes it will have a performance impact whenever the TRACE conditional compilation constant is defined during build. Doing anything has some type of impact :)
As to whether or not this has a significant impact on an application. It's highly unlikely that it would as Trace is designed to be run and is run in many production applications. Only an abuse of the feature should lead to a noticable performance difference.
But as always, don't trust me, trust the profiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With