-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
blog: quick post about Profiler.jl update work #447
Conversation
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 like some useful changes, nice work
blog/_posts/2019-09-06-profilers.md
Outdated
``` | ||
|
||
But otherwise, this seems fairly accurate, but yikes, what an arrow! I needed over 40 frames this way, and that makes this pretty hard to interpret. | ||
Spiky frame-graphs like this can be quite misleading to look at since the visual size (height) isn't relevant to performance. |
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.
I know you know this, but the width is the part that's relevant to performance---height is just recursion depth. Once you internalize that, they aren't misleading at all, as they show two "orthogonal" axes.
If there's still an underlying point you're trying to make, it might need rephrasing.
blog/_posts/2019-09-06-profilers.md
Outdated
|
||
Let's combine all those ideas to make a new option for our Julia plain-text tree view: flattened recursion. | ||
|
||
* recur – Controls the recursion handling in `:tree` format. `off` (default) prints the tree as normal. `flat` instead compresses any recursion (by ip), showing the approximate effect of converting any self-recursion into an iterator. `flatc` does the same but also includes collapsing of C frames (may do odd things around `jl_apply`). |
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.
Bulleting & quoting seem weird here (it's a 1-item list, unclear what's a keyword argument and what's a value that argument can have).
blog/_posts/2019-09-06-profilers.md
Outdated
275 ./boot.jl:330; eval(::Module, ::Any) | ||
╎ 273 ./REPL[2]:2; fib(::Int64) | ||
╎ 309 ./REPL[1]:1; fib_r(::Int64) | ||
╎ 469 ./REPL[2]:2; fib(::Int64) |
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.
469 > 309 seems a bit counterintuitive.
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.
yes it does. I'll review my code and see if something isn't being updated correctly. (It wouldn't be the first bug that writing out carefully the inputs and outputs here has caught! I've just already squashed the others into the history, haha.)
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.
Ah, haha, this is the same mistake I pointed out in Speedscope above (#447 (comment)). I need to rework some things.
blog/_posts/2019-09-06-profilers.md
Outdated
|
||
* recur – Controls the recursion handling in `:tree` format. `off` (default) prints the tree as normal. `flat` instead compresses any recursion (by ip), showing the approximate effect of converting any self-recursion into an iterator. `flatc` does the same but also includes collapsing of C frames (may do odd things around `jl_apply`). | ||
|
||
This is no longer a literal interpretation of the stack, but shows a particular linearization where each recursive call was re-written as a loop. |
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.
There's not quite enough information given to understand the rules here. I think what you mean is that if an IP appears twice in the trace, you truncate the trace at the second one. But why the second one? Why not the first one?
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.
Neither. It's not truncated, it's combined.
Fun fact: the new format=:flat
algorithm forms a subset of this new tree-flat
option, but where all calls (instead of just recursive ones) are reinterpreted as if called from a single interpreter loop. To put that in the context of Julia, if you had a tree of calls that all went through jl_apply
, the tree-flatc
and format=flat
output should start to coincide (plus-or-minus some formatting and indentation).
blog/_posts/2019-09-06-profilers.md
Outdated
╎ 3 ./REPL[2]:2; fib(::Int64) | ||
``` | ||
|
||
I think this looks cool, and vaguely even shows how I would conceptualize the functions in my head. This is availble right now only on [my jn/profile-recurflat](https://github.com/JuliaLang/julia/tree/jn/profile-recurflat) branch, but should be a PR soon, and show up in the JuliaLang v1.4 release. |
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.
You might need to expand upon what's good about this representation: why does fib
sometimes show up as a child of itself? Walk people through how many times it does the direct call vs the recursive call.
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.
I actually have no idea why that happens either. It show up in most of the other reports too—this is just the first one where it sticks out like a sore thumb. I'll add a note to call that out.
blog/_posts/2019-09-06-profilers.md
Outdated
author: <a href="http://github.com/vtjnash/">Jameson Nash</a> | ||
--- | ||
|
||
Profiling tools are awesome. They let us see what actually is affecting our program performance. Profiling tools also are terrible. They lie to us and give us confusing information. They also have some surprisingly new developments: [brendangregg's oft-cloned flamegraphs tool](http://www.brendangregg.com/flamegraphs.html) was created in 2011! So here I will be investigating some ways to make our profile reports better; and looking at ways in which they commonly break, to raise awareness of those artifacts in the reports. |
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.
oft-cloned
often cloned?
Profiling tools are awesome. They let us see what actually is affecting our program performance. Profiling tools also are terrible. They lie to us and give us confusing information. They also have some surprisingly new developments: [brendangregg's oft-cloned flamegraphs tool](http://www.brendangregg.com/flamegraphs.html) was created in 2011! So here I will be investigating some ways to make our profile reports better; and looking at ways in which they commonly break, to raise awareness of those artifacts in the reports. | |
Profiling tools are awesome. They let us see what actually is affecting our program performance. Profiling tools also are terrible. They lie to us and give us confusing information. They also have some surprisingly new developments: [brendangregg's often cloned flamegraphs tool](http://www.brendangregg.com/flamegraphs.html) was created in 2011! So here I will be investigating some ways to make our profile reports better; and looking at ways in which they commonly break, to raise awareness of those artifacts in the reports. |
520ab46
to
f5587d4
Compare
ok to publish? |
This blog post comes with a PR! JuliaLang/julia#33190