New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flat mode to console renderer #240
Conversation
276e580
to
4040e81
Compare
4040e81
to
4bd9d6c
Compare
Nice, thanks! I'll take a look soon. Just a quick note, 'exclusive time' is known as 'self time' in this project. I think it's already available as total_self_time on Frame. But, there may have been a bug in that property until recently, can't remember if it's merged or not! |
Thanks! I tried this with |
I added that fix to this PR and modified the code to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @matthiasdiener, thank you! A few comments inline. The last commit you added isn't correct though, it's not possible to say anything about 'ncalls' in pyinstrument because it is a statistical profiler - they could be many calls that pyinstrument didn't record because it's only recording every {interval}s.
This reverts commit 0689b32.
d52a191
to
9765b70
Compare
You're right, of course. I reverted that commit in bcca59c. |
leave this with me @matthiasdiener, I have some more thoughts on code structure that are probably easier to do than describe! |
Would you mind checking this still works as you intended @matthiasdiener ? I think I'm happy with it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @joerick! This still works as intended.
Co-authored-by: Matthias Diener <matthias.diener@gmail.com>
Thanks @joerick! This is still working as intended. |
thank you @matthiasdiener for this! gonna get a release out really soon |
This was inspired by a similar flat mode in vmprof. Sometimes it is interesting to focus on functions that get called from multiple locations in the call graph in order to determine which functions consume the most time overall.
Run with
pyinstrument ... -p flat
.Here is how it looks like: