-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
use chars instead of strings where applicable #108099
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Can I ask why? |
we have specializations of these functions so they run faster on |
Just in case: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 0400c68 with merge ddcb22e59e1c19d757d303194d1146af8cd7c408... |
Had a quick look with godbolt and a pub fn main() {
let x = String::from("hello world");
let _ = x.replace('x', &x);
} emits only around half of the number instructions of pub fn main() {
let x = String::from("hello world");
let _ = x.replace("x", &x);
} with opt-level=3 |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ddcb22e59e1c19d757d303194d1146af8cd7c408): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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 may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
@bors r+ rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#106347 (More accurate spans for arg removal suggestion) - rust-lang#108057 (Prevent some attributes from being merged with others on reexports) - rust-lang#108090 (`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`) - rust-lang#108092 (note issue for feature(packed_bundled_libs)) - rust-lang#108099 (use chars instead of strings where applicable) - rust-lang#108115 (Do not ICE on unmet trait alias bounds) - rust-lang#108125 (Add new people to the compiletest review rotation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.