Repository navigation
Canonicalization cleanups - #165537
Canonicalization cleanups#165537
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.
Canonicalization micro-optimizations
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (bad7b83): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 2.4%, secondary 3.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.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: 481.055s -> 482.135s (0.22%) |
Currently we build it even when the `NEEDS_CANONICAL` test fails.
It has a single call site. This will enable an optimization in the next commit.
Do a `NEEDS_CANONICAL` check on the entire input. We already have such checks on the relevant parts, but this lets us entirely avoid building a `Canonicalizer` when the check fails.
It causes it to intern or not intern. Instead we can just let the call site that passes in `true` do its own interning.
aca70bd to
d7064be
Compare
|
LLM disclosure: some of the ideas in this PR came from LLM analysis. I wrote the code and text myself. |
|
|
|
|
|
Of the five commits:
Commits 1 and 3 are the perf optimizations. We could choose to remove them because they have no effect on CI, but they did have a small effect for me locally so we could keep them for non-PGO platforms. Commits 2, 4, and 5 are refactorings that I think are worth merging regardless. |
There was a problem hiding this comment.
Commit 1 and 3 also look good to me regardless of the perf 😄
@bors r+ rollup
Rollup of 9 pull requests Successful merges: - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims) - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - #165750 (Wrap proc-macro `EscapeError` enum into a struct) - #164218 (Tweak private re-export errors to point at correct span and have more context) - #165021 (In irrefutable patterns, the FieldPat is skipped, which means the name: field is not printed) - #165537 (Canonicalization cleanups) - #165772 (Remove unnecessary mut from HirIdValidator::check_nested_id) - #165779 (make improper_ctypes accept `x87_f80`) - #165780 (std: map more errno values to ErrorKind on Hermit)
Rollup merge of #165537 - nnethercote:canonicalization-micro-opts, r=ShoyuVanilla Canonicalization cleanups I saw some moderate perf improvements locally with these changes but on CI they had no effect. Maybe due to PGO? Most of the changes are actually refactorings which I think are still worth merging. r? @ShoyuVanilla
Rollup of 9 pull requests Successful merges: - rust-lang/rust#165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims) - rust-lang/rust#165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - rust-lang/rust#165750 (Wrap proc-macro `EscapeError` enum into a struct) - rust-lang/rust#164218 (Tweak private re-export errors to point at correct span and have more context) - rust-lang/rust#165021 (In irrefutable patterns, the FieldPat is skipped, which means the name: field is not printed) - rust-lang/rust#165537 (Canonicalization cleanups) - rust-lang/rust#165772 (Remove unnecessary mut from HirIdValidator::check_nested_id) - rust-lang/rust#165779 (make improper_ctypes accept `x87_f80`) - rust-lang/rust#165780 (std: map more errno values to ErrorKind on Hermit)
I saw some moderate perf improvements locally with these changes but on CI they had no effect. Maybe due to PGO? Most of the changes are actually refactorings which I think are still worth merging.
r? @ShoyuVanilla