Skip to content
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

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

matthiaskrgr
Copy link
Member

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Feb 15, 2023

r? @GuillaumeGomez

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 15, 2023
@ChrisDenton
Copy link
Member

Can I ask why?

@matthiaskrgr
Copy link
Member Author

we have specializations of these functions so they run faster on chars

@GuillaumeGomez
Copy link
Member

Just in case:

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 15, 2023
@bors
Copy link
Contributor

bors commented Feb 15, 2023

⌛ Trying commit 0400c68 with merge ddcb22e59e1c19d757d303194d1146af8cd7c408...

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Feb 15, 2023

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

@bors
Copy link
Contributor

bors commented Feb 16, 2023

☀️ Try build successful - checks-actions
Build commit: ddcb22e59e1c19d757d303194d1146af8cd7c408 (ddcb22e59e1c19d757d303194d1146af8cd7c408)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ddcb22e59e1c19d757d303194d1146af8cd7c408): comparison URL.

Overall result: ✅ improvements - no action needed

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 may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.6% [-1.6%, -1.6%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.6%, -1.7%] 2
All ❌✅ (primary) - - 0

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2023
@GuillaumeGomez
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 16, 2023

📌 Commit 0400c68 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 16, 2023
…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
@bors bors merged commit 09a2267 into rust-lang:master Feb 16, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants