Type: Technical task
Fix Version/s: None
Sprint:AP S22-6 (May)
Eric Bellm suggested using pyinstrument to get profiling information that does not have the timing decorators causing confusing call graphs. It looks like there are quite a few other statistical profilers available (e.g. this stack overflow discussion), so if pyinstrument doesn't work, we could try another one.
A possible output of this ticket would be a new section added to the dev guide python profiling section. Speaking of which, that could probably use a paragraph on snakeviz, and some updated notes on gprof2dot: there's a single sentence, and a reference to another tool (runsnakerun) that was last updated in 2011...
Eric Bellm: Can you please review the dev guide PR? I made several changes to the python profiling docs, which should make them more useful to others.
The rendered output is here: https://developer.lsst.io/v/DM-34882/python/profiling.html
I was able to run pyinstrument, and played around with some of its options. Some comments:
DM-34881, but with DM-34881(timer disabled) the standard profiler works fine, I think. I've attached a speedscope flamegraph: mouseover gives more info about each box, but I don't know that we'll learn much more from this, compared with the normal profiler.
So, I think my preference is to just run with the timer disabled via my
DM-34881hack, since it cleans up the call graph in a way that we'd want anyway.
It might be worth adding a couple of sentences to the dev guide section about profilers about it, so others can be aware of the option?