Timings reported by Profiler far exceed actual runtimes
splmal
Posts: 2
I am using the trial version of ANTS Profiler to evaluate for the company I work for. I had a few issues with getting it to run, but this forum has been very helpful (I needed to register some DLLs). I am hoping it will be helpful in determining the cause of the timing discrepancies I am seeing.
Here is the scenario:
I am profiling code that loads 598 documents into a database. When I run this routine from start to finish it only takes about 6 seconds. I've timed this with both a stop watch and TimeSpan objects in the code. However, when I profile the same code the method being timed reports that the method takes approximately 2 to 3 times longer than what is possible.
Any thoughts on what I am not seeing here? The counts look fine, but timings appear greatly inflated.
When I look through all the methods and their timings everything makes sense except for this:
XmlValidatingReader xvr = new XmlValidatingReader(xrd);
xvr.Schemas.Add(_xs);
The last line of code is reported as taking up 5.75 seconds which isn't possible. It is part of System.Xml namespace in .NET 1.1.
If I take this value out of the equation then the timing values across the board add up to the actual runtime of the method I was testing.
Here is the scenario:
I am profiling code that loads 598 documents into a database. When I run this routine from start to finish it only takes about 6 seconds. I've timed this with both a stop watch and TimeSpan objects in the code. However, when I profile the same code the method being timed reports that the method takes approximately 2 to 3 times longer than what is possible.
Any thoughts on what I am not seeing here? The counts look fine, but timings appear greatly inflated.
When I look through all the methods and their timings everything makes sense except for this:
XmlValidatingReader xvr = new XmlValidatingReader(xrd);
xvr.Schemas.Add(_xs);
The last line of code is reported as taking up 5.75 seconds which isn't possible. It is part of System.Xml namespace in .NET 1.1.
If I take this value out of the equation then the timing values across the board add up to the actual runtime of the method I was testing.
This discussion has been closed.
Comments
Thanks for your forum post. I'll pass this on to the relevant people to look at.
In general, though ANTS Profiler can produce inflated times with recursive code and very, very tight loops.
We're also on the verge of an update release that may produce improved results.
my name is Tom Harris; I'm responsible for the development of ANTS Profiler. I'm sorry to hear that the timings are not coming out right with the app you are profiling. The most likely explanation is that recursive functions are being called at some point. This may not necessarily be in your code, but in the heart of the .NET Framework libraries. We have an open issue with gathering timings for recursive methods that will hopefully be mopped in the next update.
Could you send through a set of profiling results to support@redgate.com? It would be useful if they were generated with 'Profile all .NET methods' so that we can drill into the data.
Many thanks,
Tom