-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Cow'ify some pprust methods #88262
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
Cow'ify some pprust methods #88262
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
Could you please adjust the PR description to include some motivation for this change (i.e. the why?) |
I'm confident that the goal of this PR is performance. It might be worth running a benchmark on this. |
@r00ster91 I've edited PR description, previously it was empty. |
Right, the goal of my request was to make sure there's less guessing involved as to what the motivation really is. I don't think pretty printer is at all performance critical and therefore value of a benchmark here seems fairly low (and also pretty high-effort). The changes also don't seem all that intrusive either, so I'm happy to approve this based on the intuition that things are better this way. Can you please also squash the commits together? r=me afterwards. |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 5ca71fed1af4c962d0fb4dfccdb084146894066e with merge f91948fcb5e5a8daf32eabb6124dff78604d248e... |
☀️ Try build successful - checks-actions |
Queued f91948fcb5e5a8daf32eabb6124dff78604d248e with parent 47ab5f7, future comparison URL. |
Finished benchmarking try commit (f91948fcb5e5a8daf32eabb6124dff78604d248e): comparison url. Summary: This change led to moderate relevant improvements 🎉 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
…o reduce potential reallocations
Squashed. |
@bors r+ |
📌 Commit c565339 has been approved by |
☀️ Test successful - checks-actions |
Reduce number of potential needless de/allocations by using
Cow<'static, str>
instead of explicitString
type.