-
Notifications
You must be signed in to change notification settings - Fork 13.3k
hygiene: Ensure uniqueness of SyntaxContextData
s
#130324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I've added many asserts, I'll change them to debug asserts if they affect performance. |
This comment has been minimized.
This comment has been minimized.
hygiene: Ensure uniqueness of `SyntaxContextData`s `SyntaxContextData`s are basically interned with `SyntaxContext`s working as keys, so they are supposed to be unique. However, currently duplicate `SyntaxContextData`s can be created during decoding from metadata or incremental cache. This PR fixes that. cc rust-lang#129827 (comment)
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (b517457): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary 1.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -12.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.5%, secondary -0.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 756.444s -> 757.208s (0.10%) |
I'm not super fond of the "hopefully" rhetoric... |
Right now they are not a tree because the |
FIXME: The holes left by decoder break the logic assigning UPD: Fixed in the last commit. |
Ah, there's one more thing - not all contexts are coming from the decoder (during incremental compilation at least). Many contexts come from the freshly redone compilation (which is typically done before incremental decoding starts) and then they need to "unify" with equivalent contexts coming from decoding - that's where the duplicates were coming from before this PR. So even if all decoding is done in proper order, you can still decode and get a context that is equivalent to one of the freshly built ones, but you don't know it until you decode it and compare. Maybe if #129827 eliminates recursion we'll be able to avoid reserving |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (75fac58): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -1.6%, secondary -0.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.5%, secondary -0.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 773.052s -> 772.368s (-0.09%) |
I'll try to get rid of the holes in syntactic contexts after #129827 lands (I'll update it myself if @bvanjoi is unavailable). |
r? compiler |
@bors r+ |
☀️ Test successful - checks-actions |
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 f1bc669 (parent) -> 19cab6b (this PR) Test differencesShow 8 test diffsAdditionally, 8 doctest diffs were found. These are ignored, as they are noisy. Job group index |
Finished benchmarking commit (19cab6b): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -1.4%, secondary 0.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -0.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.5%, secondary -0.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 777.678s -> 777.548s (-0.02%) |
Perf triage: Improvements outweigh regressions. Regression @rustbot label: +perf-regression-triaged |
SyntaxContextData
s are basically interned withSyntaxContext
s working as indices, so they are supposed to be unique.However, currently duplicate
SyntaxContextData
s can be created during decoding from metadata or incremental cache.This PR fixes that.
cc #129827 (comment)