vpelletier / pprofile

Line-granularity, thread-aware deterministic and statistic pure-python profiler
GNU General Public License v2.0
445 stars 28 forks source link

Potential UI improvements for the statistical profiler #45

Open bbbbbbbbba opened 2 years ago

bbbbbbbbba commented 2 years ago

I find the statistical profiler to be rather useful for line profiling, but I think there are some ways in which the UI can be improved for the statistical profiler:

  1. Since precise timing information is not available, the result output by print_stat would not show any percentage information. I think it would be more helpful if print_stat prints the percentage of hits when timing information is not available.
  2. In examples in the documentation, irrelevant lines are replaced with "[...]", which makes it easier to understand the examples. I think it might actually be possible to do this programmatically by detecting consecutive lines with hit counts below a threshold. This will help especially since threading.py will always appear in the results but is usually irrelevant.

If people agree with these ideas, maybe I can find some time to implement them and create a pull request.