jiffyclub / snakeviz

An in-browser Python profile viewer
https://jiffyclub.github.io/snakeviz/
Other
2.36k stars 139 forks source link

Profile accuracy #177

Open zuivu opened 2 years ago

zuivu commented 2 years ago

Since SnakeViz only supports cProfile and pstats modules which don't provide extremely high accuracy (resolution of 0.001 ~ 1000 ticks/second) compare to those from time module in the table below). I wonder if is there a way to use/produce profiler from SnakeViz with higher tick rate (top 3 choices from the table below). Also, how much more value do you think I can gain from these higher tick rate options, compared to just using the current method (cProfile).

Link to table image

Helveg commented 2 years ago

I'm not sure this applies to Snakeviz as you can provide a custom timing function to the Profile class of both profile and cProfile: https://docs.python.org/3/library/profile.html#using-a-custom-timer

The generated profiles should be completely readable by snakeviz. Is this not the case?