devopspp / pyliveupdate

A runtime python code manipulation framework for profiling, debugging and bugfixing
GNU General Public License v3.0
64 stars 10 forks source link

Feature: time-based charts #4

Closed williame closed 4 years ago

williame commented 4 years ago

Flamegraphs are great, and useful, and shouldn't go away.

But consider a program that spends a lot of time in some init code, and then spends its time in something else etc. What is 'hot' changes over time.

Another way of plotting is with time on the x axis. This can look like this: https://williame.github.io/post/35134924139.html

I don't do much python profiling any more, but have done similar tooling for the languages I am working in now. I find it complements flamegraphs nicely, and that's why I mention it here.

EvonX commented 4 years ago

Hi William,

Thanks for pointing this out! I like the idea of plotting time as x axis and especially highlighting the common stack base when clicking. It is a great idea!

I actually think using time as x axis fits into our tool more than flamegraph. Our tool instruments specified functions' begin and end to record timestamp. Therefore, compared with sampling, it can get more precisely when a function begin running and when it stop running. With flamegraph the time order information is totally gone.

We would definitely consider implementing this feature in our tool. Would you mind if we reuse some of your will_profile's visualization code in our tool? I found the figure your tool draws is very pretty.

Thanks! Evon

williame commented 4 years ago

Yeap, use my code, no problem! Best of luck.