rust
rust copied to clipboard
Specialize `ToString` implementation on `u128` and `i128`
Part of https://github.com/rust-lang/rust/issues/135543.
Follow-up of rust-lang/rust#136264.
When working on https://github.com/rust-lang/rust/pull/142098, I realized that i128 and u128 could also benefit from the ToString specialization so here it.
The last commit is just me realizing that I forgot to add the format tests for usize and isize.
r? @workingjubilee
rustbot has assigned @workingjubilee. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
:umbrella: The latest upstream changes (presumably #136594) made this pull request unmergeable. Please resolve the merge conflicts.
Fixed merge conflicts.
Having done code review of things that use Rust's feature(min_specialization), I now consider "specialization" a dirty word.
Noted, thanks for the title update then. :)
@tgross35 I added the comparison in the first comment with the code I use to get the performance comparison.
Thanks!
I don't think this needs a pre-merge perf run since we didn't see any perf-visible impact in https://github.com/rust-lang/rust/pull/136594, but it wouldn't hurt to get one after so
@bors r+ rollup=never
Fyi @pascaldekloe since you did the last round of perf boosts for these methods
:pushpin: Commit 9b09948897886541bc4f31a9d07bf4a2e1680171 has been approved by tgross35
It is now in the queue for this repository.
:hourglass: Testing commit 9b09948897886541bc4f31a9d07bf4a2e1680171 with merge 5b74275f89b6041bf2e9dc2abcf332e206d4cfca...
:sunny: Test successful - checks-actions Approved by: tgross35 Pushing 5b74275f89b6041bf2e9dc2abcf332e206d4cfca to master...
What is this?
This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 255aa220821c05c3eac7605fce4ea1c9ab2cbdb4 (parent) -> 5b74275f89b6041bf2e9dc2abcf332e206d4cfca (this PR)
Test differences
Show 26 test diffs
Stage 1
num::test_isize_to_string: [missing] -> pass (J0)num::test_usize_to_string: [missing] -> pass (J0)
Additionally, 24 doctest diffs were found. These are ignored, as they are noisy.
Job group index
- J0: aarch64-apple, aarch64-gnu, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, mingw-check-2, test-various, x86_64-apple-1, x86_64-gnu, x86_64-gnu-aux, x86_64-gnu-llvm-19-2, x86_64-gnu-llvm-19-3, x86_64-gnu-llvm-20-2, x86_64-gnu-llvm-20-3, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1
Test dashboard
Run
cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 5b74275f89b6041bf2e9dc2abcf332e206d4cfca --output-dir test-dashboard
And then open test-dashboard/index.html in your browser to see an overview of all executed tests.
Job duration changes
- dist-aarch64-apple: 4689.2s -> 6379.9s (36.1%)
- x86_64-apple-2: 3543.9s -> 4546.3s (28.3%)
- dist-x86_64-apple: 9048.3s -> 7868.7s (-13.0%)
- mingw-check-tidy: 77.1s -> 69.0s (-10.5%)
- x86_64-apple-1: 6181.5s -> 6732.2s (8.9%)
- x86_64-rust-for-linux: 2603.2s -> 2819.3s (8.3%)
- i686-gnu-1: 7677.0s -> 7174.4s (-6.5%)
- x86_64-gnu-llvm-20-3: 6777.2s -> 6353.4s (-6.3%)
- dist-aarch64-linux: 8178.3s -> 7691.0s (-6.0%)
- dist-x86_64-netbsd: 4763.9s -> 5035.2s (5.7%)
How to interpret the job duration changes?
Job durations can vary a lot, based on the actual runner instance that executed the job, system noise, invalidated caches, etc. The table above is provided mostly for t-infra members, for simpler debugging of potential CI slow-downs.
Finished benchmarking commit (5b74275f89b6041bf2e9dc2abcf332e206d4cfca): comparison URL.
Overall result: ✅ improvements - no action needed
@rustbot label: -perf-regression
Instruction count
Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.2% | [-0.2%, -0.2%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
Results (primary -1.9%, secondary -2.4%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
2.8% | [2.8%, 2.8%] | 1 |
| Improvements ✅ (primary) |
-1.9% | [-2.4%, -1.3%] | 5 |
| Improvements ✅ (secondary) |
-2.6% | [-6.8%, -1.0%] | 23 |
| All ❌✅ (primary) | -1.9% | [-2.4%, -1.3%] | 5 |
Cycles
Results (secondary 4.3%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
5.2% | [2.0%, 10.5%] | 9 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-3.9% | [-3.9%, -3.9%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
This benchmark run did not return any relevant results for this metric.
Bootstrap: 692.261s -> 692.705s (0.06%) Artifact size: 371.96 MiB -> 372.00 MiB (0.01%)