-
-
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
Optimize show(io::IO, m::Module) #42773
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.
LGTM modulo the suggested fix. (Maybe we need a small unit test for this?)
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf.
cb5bc66
to
97fb3a3
Compare
Tagged for backport to 1.6 and 1.7 as a low-risk optimization :). |
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.
LGTM
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf. (cherry picked from commit ca6b3ba)
Thanks for reviewing/merging gentlemen! :) |
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf. (cherry picked from commit ca6b3ba)
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf. (cherry picked from commit ca6b3ba)
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf. (cherry picked from commit ca6b3ba)
Why not |
The PR here was for performance as shown in the first post. Did you benchmark that version and find that it performs the same as the one proposed here? |
My bad, (the |
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf.
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf.
show(io::IO, m::Module) allocates. This commit provides an implementation that does not allocate, improving perf. (cherry picked from commit ca6b3ba)
This method appeared as a hotspot in code that stringifies many types.