jspraul / slimtune

Automatically exported from code.google.com/p/slimtune
MIT License
0 stars 0 forks source link

Time measurements for a method are not specific to the call stack in which they are shown. #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to debug a puzzling performance problem in a benchmark. A method 
called "Add" is called repeatedly in two different benchmarks. In the first 
benchmark "Add" has the expected level of performance (actually it is slow, but 
for a good reason), but in the second benchmark, the same method has very poor 
performance and I want to know why. However, when I step through the code in 
the debugger, the code appears to behave exactly as intended, so I was hoping 
Slimtune could help.

However, when I look at the two call stacks in Slimtune, it looks the numbers 
for one call stack are merely scaled versions of the numbers for the other call 
stack. Then I noticed that "Add" supposedly calls some methods that it could 
not have called in that particular call stack--methods that it only calls under 
different call stacks.

So it seems to me that Slimtune actually only keeps track time on a per-method 
basis, ignoring the actual call stacks, and then the call stacks are 
"reconstructed" later by keeping track of which methods call which other 
methods. However, obviously, simply knowing which methods call which methods is 
not enough information to accurately reconstruct a complete call tree.

Unfortunately I can't just profile the second benchmark by itself because the 
performance problem disappears if I don't run the first benchmark first. As a 
workaround, I wish I could simply turn off profiling during the first 
benchmark, but it seems like Slimtune has no "pause data collection" button.

If you would respond to Issue 60, I would consider enhancing Slimtune myself 
with the needed features (assuming that the profiler has the ability to gather 
complete call stacks?) It's important to have a developer who is willing to 
answer questions about the code.

Original issue reported on code.google.com by qwertie...@gmail.com on 7 Apr 2013 at 5:15