-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 pretty-printing for inference timing #38596
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.
👍 Thanks, love this! I've left a small suggestion, but otherwise LGTM
base/show.jl
Outdated
show_tuple_as_call(io, def.name, mi.specTypes, false, nothing, argnames, true) | ||
end | ||
else | ||
print(io, "Toplevel InferenceFrameInfo thunk") |
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.
Is there nothing else that can be usefully printed, here?
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 figured something out. Now it prints thunk from $module starting at $file:$line
which seems like an improvement.
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.
Amazing. Me too. Thanks!
* Add minimal printing for Core.Compiler.Timings.Timing These objects are huge when printed with `show_default`. This makes the printing very brief. More detail is available with with AbstractTrees.print_tree. * Add nice printing for Core.Compiler.Timings.InferenceFrameInfo This inlines the `Core.Const` args into the signature, which results in a very compact way to see both the type and the value, when applicable. Co-authored-by: Nathan Daly <NHDaly@gmail.com>
648853c
to
e460f7d
Compare
This adds pretty-printing for
Core.Compiler.Timings
objects. Let's see this in action.Old printing:
With the new printing:
Much shorter, but note that the unqualified
ROOT()
has becomeCore.Compiler.Timings.ROOT()
to help people find the method. If you do want to see the whole thing at once, you can get that with JuliaCollections/AbstractTrees.jl#65.Also:
A key feature to notice here is that the
Core.Const
values are integrated into the signature:getindex(::Tuple{UInt8, Float16}, 2::Int64)
means that we inferredx[2]
wherex::Tuple{UInt8, Float16}
.Review requested from @NHDaly.
EDIT: the original version made changes to MethodInstance printing. I'll submit that separately.