Repository navigation
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
[perf] Store an interned string in `LitKind::Int` instead of a packed u128 integer
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 5b7a44b failed: CI. Failed jobs:
|
|
@Kobzol Was just looking at this one. If we add an interner for integers, we could have a format in which we store most integers inline and then intern the unusual ones. For instance, store values in the range of an i31 directly, store other values interned and set the high bit to indicate an interned IDs. (We could also get cleverer with the encoding, using some subset of the tricks ARM literal encoding does, but in practice I expect we'd pay much more in encoding/decoding than we'd save by inlining large-but-low-entropy values. |
|
Yeah, that would be my next attempt, to have a 32-bit number that can be either inlined or interned (for the rare large literals). I first wanted to see perf with just storing a string though (have to fix the code first..). |
2b4e117 to
f6881f8
Compare
|
@bors try |
This comment has been minimized.
This comment has been minimized.
[perf] Store an interned string in `LitKind::Int` instead of a packed u128 integer
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This comment has been minimized.
This comment has been minimized.
|
Related discussion (and experiment): #159008 (comment) |
|
Finished benchmarking commit (b970737): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.9%, secondary -2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.893s -> 491.79s (0.39%) |
|
This is perf. with the integer literal interning approach. Seems that @nnethercote was right, and this isn't worth it! |
|
@Kobzol For the integer literal inlining approach, assuming I've read the code correctly, it's doing an unsigned packing, so |
|
I don't think that the specific interning implementation matters that much, because we didn't see any max RSS wins, and those won't really change much regardless of how we intern. It seems that reducing |
|
☔ The latest upstream changes (presumably #165151) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Opening for perf. An alternative could be to have a separate interner only for integer literals.