nvdv / vprof

Visual profiler for Python
BSD 2-Clause "Simplified" License
3.95k stars 154 forks source link

Allow code heatmap to show time taken per line as well as execution count #58

Closed mdfirman closed 7 years ago

mdfirman commented 8 years ago

Thanks for a great tool! This visual profiler is what I was looking for in Python.

I was surprised though that the code heatmap only shows the execution count for the colour highlighting, and for the mouseovers. For me it is far more interesting to know how long each line took, not just how many times it is run. Of course this is also somewhat in the flame graph, but not in the same format.

It would be great to be able to select what the code heatmap shows, effectively allowing the user to choose between the columns of line_profiler. This could be in the command-line options, but ideally could be in a drop-down menu in the code heatmap screen. I believe matlab's profiler offers something similar.

Thanks

nvdv commented 8 years ago

Thanks for reporting!

dlorch commented 7 years ago

Upvote +1 for this feature request ;-)

nvdv commented 7 years ago

I've just pushed a few commits with initial version of this feature. Might be rough around the edges. That's how code heatmap looked like: exec_heatmap That's how it looks now: time_heatmap

dlorch commented 7 years ago

This looks very cool!

nvdv commented 7 years ago

Thanks. This feature still requires some improvements and more testing, so I will post updates here.

nvdv commented 7 years ago

I've just uploaded this feature to PyPI. At present It tracks main thread only, since it does not require major changes to UI.