Fix non-deterministic encoding of syntax contexts - #161450
Conversation
This comment has been minimized.
This comment has been minimized.
b07d315 to
3f750ec
Compare
This comment has been minimized.
This comment has been minimized.
494d4da to
5fa08c7
Compare
This comment has been minimized.
This comment has been minimized.
a34d24f to
3868148
Compare
This comment has been minimized.
This comment has been minimized.
|
@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.
…ing, r=<try> Fix non-deterministic encoding of syntax contexts
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (7e01adf): comparison URL. Overall result: ❌ regressions - 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.0%, secondary -1.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.2%, secondary 4.5%)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: 476.065s -> 474.462s (-0.34%) |
3868148 to
4846400
Compare
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e742195): 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 0.8%, secondary -1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.4%, secondary 4.0%)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: 479.129s -> 477.217s (-0.40%) |
…nkov Refactor `HygieneEncodeContext` Some refactorings around `HygieneEncodeContext` with minor perf improvements, the most notable thing is that `Lock`s were removed. First part for rust-lang#161450. r? @petrochenkov
…nkov Refactor `HygieneEncodeContext` Some refactorings around `HygieneEncodeContext` with minor perf improvements, the most notable thing is that `Lock`s were removed. First part for rust-lang#161450. r? @petrochenkov
…nkov Refactor `HygieneEncodeContext` Some refactorings around `HygieneEncodeContext` with minor perf improvements, the most notable thing is that `Lock`s were removed. First part for rust-lang#161450. r? @petrochenkov
Refactor `HygieneEncodeContext` Some refactorings around `HygieneEncodeContext` with minor perf improvements, the most notable thing is that `Lock`s were removed. First part for #161450. r? @petrochenkov
…nkov Refactor `HygieneEncodeContext` Some refactorings around `HygieneEncodeContext` with minor perf improvements, the most notable thing is that `Lock`s were removed. First part for rust-lang#161450. r? @petrochenkov
Rollup merge of #162520 - aerooneqq:hygiene-perf, r=petrochenkov Refactor `HygieneEncodeContext` Some refactorings around `HygieneEncodeContext` with minor perf improvements, the most notable thing is that `Lock`s were removed. First part for #161450. r? @petrochenkov
This comment has been minimized.
This comment has been minimized.
3bfb66a to
56c09cd
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
|
@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.
…ing, r=<try> Fix non-deterministic encoding of syntax contexts
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (39a7792): comparison URL. Overall result: ❌ regressions - 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 -0.6%, secondary -0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -5.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 492.1s -> 494.686s (0.53%) |
|
|
||
| drop(mut_hctxt); | ||
|
|
||
| all_ctxt_data.sort_by_key(|(idx, _)| *idx); |
There was a problem hiding this comment.
Is sorting actually necessary here?
It seems like new not yet encoded contexts may already go in the sorted order.
| /// however, the order of encoding is deterministic, so we can remap allocated | ||
| /// syntax context ids into encoding indices and use them, thus outputting | ||
| /// same metadata. | ||
| encoding_indices: FxHashMap<SyntaxContext, u32>, |
There was a problem hiding this comment.
We can try benchmarking IndexVec here, it's less memory efficient, but the lookup should be faster.
View all comments
Reiteration of #157409. Explanation can be found in comment for
encoding_indicesand in the issue.Fixes #129094. Blocked by #161353.
r? @petrochenkov
No llms used.