Question

I've started profiling a script which has many sleep(n) statements. All in all, I get over 99% of the run time spent sleeping. Nevertheless, it occasionally runs into performance problems during the time that it does real work but the relevant, interesting profiling data becomes very difficult to identify when e.g. using kcachegrind.

Is there a way I can blacklist certain calls/functions from being profiled? Alternatively, how can I filter out such call with post-processing of the profiling data file?

I'm using the profilestats decorator ( http://pypi.python.org/pypi/profilestats ).

Thanks

Was it helpful?

Solution

You need more than just excluding samples during sleep(). You need the remaining samples to tell you something useful. That would be stack sampling, on wall-clock time, summarizing percent at the line-of-code level. Zoom is a good tool for this kind of sampling, and I would hope it's not too hard to ignore samples that contain a particular function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top