This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 9d272a1
committed
Auto merge of rust-lang#122102 - Urgau:optimize-symbol-integer, r=cjgillot
Optimize `Symbol::integer` by utilizing in-place formatting
This PR optimize `Symbol::integer` by utilizing `itoa` in-place formatting instead of going through a dynamically allocated `String` and the format machinery.
<details>
For some context: I was profiling `rustc --check-cfg` with callgrind and due to the way we currently setup all the targets and we end-up calling `Symbol::integer` multiple times for all the targets. Using `itoa` reduced the number of instructions.
</details>3 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4572 | 4572 | | |
4573 | 4573 | | |
4574 | 4574 | | |
| 4575 | + | |
4575 | 4576 | | |
4576 | 4577 | | |
4577 | 4578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2327 | 2327 | | |
2328 | 2328 | | |
2329 | 2329 | | |
2330 | | - | |
| 2330 | + | |
2331 | 2331 | | |
2332 | 2332 | | |
2333 | 2333 | | |
2334 | 2334 | | |
2335 | 2335 | | |
2336 | | - | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
2337 | 2339 | | |
2338 | 2340 | | |
2339 | 2341 | | |
| |||
0 commit comments