Today I experienced something that made me really angry against Visual Studio 2008 Profiler! I spent half a day to try find why a certain program was slow at determinate operations, I was focusing to some complex methods because profiler was pointing me there and I was seeing no other sign of issues around.
Well, after losing a lot of hours, Mizokunimito came into rescue and promptly remembered me to avoid trusting this profiler.
I said “You’re joking. If the profiler shows me that this method reports the major number of samples then is the place to look for optimizations… ok, … if the profiler is right, and I really hope so”.
Well, he was completely right on that, Profiler was cheating. Some method calls were COMPLETELY MISSING FROM THE REPORT, thus pointing us to look at the wrong direction.
We saw that by manually adding some StopWatch.Start/Stop calls, and dumping the timings on the method that profiler, the time required to execute that method was only a few ms, compared to the simulation that was saying more than 1500 ms!!
Now, I know and we use Visual Studio 2010 for other projects, but in this case we had to keep the Visual Studio 2008 project for a number of reasons, so we had to use an “old” version of the profiler, … but… I have to admit, …
I learned another time, that
1) We should never trust software too much , and be always as St. Thomas… trust only your eyes, and look also where you think that there are no issues… because sometimes Murphy Law helps making this the actual answer to your performance issues!
2) Working on a real Team is a great thing!