improve format impl for literals#97480
Conversation
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
@bors r+ rollup=never |
|
📌 Commit 738d100438d9b099fed604cfa3b1eae47a191a43 has been approved by |
738d100 to
2869092
Compare
|
How does one re-request a review 😅 |
2869092 to
5dd0fe3
Compare
|
@bors r=joshtriplett |
|
📌 Commit 5dd0fe3 has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (4a8d2e3): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
|
Visiting for weekly rustc-perf performance triage.
@rustbot label: perf-regression-triaged |
The basic idea of this change can be seen here https://godbolt.org/z/MT37cWoe1.
Updates the format impl to have a fast path for string literals and the default path for regular format args.
This change will allow
format!("string literal")to be used interchangably with"string literal".to_owned().This would be relevant in the case of
f!"string literal"being legal (rust-lang/rfcs#3267) in which case it would be the easiest way to create owned strings from literals, while also being just as efficient as any other impl