nvdv / vprof

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

Remove entries < 0.2% of total runtime #71

Closed jonashaag closed 6 years ago

jonashaag commented 6 years ago

If you have a lot of files (say, thousands), many of them aren't going to account for more than 0.X% of total runtime. However they will be rendered in the result list, making the UI load for a very long time or crash.

This is a working PoC of removing any entry <0.2% of total runtime from the results prior to serving them to the UI.

Another approach may be to include only the top 99% (or whatever) time consumers, but this didn't work as well as the fixed threshold approach.

nvdv commented 6 years ago

Thanks! This one is tricky, because code heatmap was designed not with thousands of files in mind. The idea was to see time distribution over the source code how it is and if the scope is too large - you just can limit it by profiling less code or use another view.

jonashaag commented 6 years ago

Well maybe I don't know which files spend most time beforehand. Why not simply filter it afterwards? This kind of filter makes sense for all visualisations – you will probably want to remove this kind of noise anyways.

nvdv commented 6 years ago

Also current code heatmap can operate as coverage tool (it displays line execution count), so changing it's behaviour as suggested will disable that. One of possible options is enabling/disabling heatmap rendering for specific files (e.g. with checkbox), but it's not as straightforward as it seems.

jonashaag commented 6 years ago

Or add a CLI flag for the threshold

nvdv commented 6 years ago

This is also tricky since CLI is already cluttered 😄

jonashaag commented 6 years ago

I'm sorry to see you decided against this :(