Comments
3 comments
-
I've just read a few posts about tight loops where the overhead calculation massively slows thigns down and inflates reported answers. Maybe that's what we're seeing?
-
Hi Danny,
Yes, that's fairly accurate. The overhead calculation can suffer if a very few lines of code are looped. I don't believe that this is the major reason for the code actually running more slowly when an application is 'under the influence' of Profiler. The re-written core of ANTS Profiler 4 will hopefully be quite a bit more accurate. -
Brian Donahue wrote:I don't believe that this is the major reason for the code actually running more slowly
It's not a big deal, and we changed some things around that seemed to solve it. I've also been playing with the new version and I'll keep an eye on how things go with that one
Add comment
Please sign in to leave a comment.
If I run the code manually, it takes 2.2 seconds. When I run it under the profiler the profiler reports Program.Main() taking 18.8 seconds.
I understand that things take longer under the profiler due to its overhead, but I'm talking about the final report. It shows Program.Main() as taking 18 seconds, which as I understood should have been the "actual time had the profiler not been attached".
ValueType.GetHashCode seems to be completely evil (lots of ValueType methods are using Reflection under the hood to loop through all fields), and we're trying to change our code to remove this. However I thought you might be interested in checking this out