Pstats reporting

In the past, when I’ve used Pstats, I’ve used it with the smooth option enabled. With my latest performance issue, I’ve found that the median and average are very far off due to a few, but very drastic outliers. When using the non-smoothed Pstats reporting, is every data point you see directly from one collected from the code? So if I’m seeing a bunch of timings at 2.3 ms and than one at 33ms, this is some sort of hitch, and couldn’t be attributed to a sampling problem of filtered timing data?


Right. Without turning on smoothing, you are seeing actual measured samples–there is no implicit smoothing in PStats. So your 33ms measurement is some sort of hitch.

Note that other processes running on the same machine can often cause hitches like this, particularly on Windows. Even PStats itself can cause a lot of noise in the graph. This is one reason why it’s useful to run the PStats graph on another machine than the one you’re measuring.