-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
use Vec for region constraints instead of BTreeMap #118824
Conversation
Failed to set assignee to
|
59acb33
to
fb14cf7
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
use Vec for region constraints instead of BTreeMap ~1% perf gain Diagnostic regressions need more investigation. r? `@ghost`
@@ -273,7 +272,7 @@ pub(crate) enum UndoLog<'tcx> { | |||
AddVar(RegionVid), | |||
|
|||
/// We added the given `constraint`. | |||
AddConstraint(Constraint<'tcx>), | |||
AddConstraint(usize), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be an IndexVec :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or simply remove the index from AddConstraint
? 🤷♂️ It is useless and I only added it for consistency with AddVerify
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is useless and I only added it for consistency with
AddVerify
.
This is wrong. The index was actually needed in in leak_check code, but now I have removed the UndoLog altogether so it doesn't matter anymore (*edit: I reverted this commit).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a newtype index seems incompatible with sorting and deduplicating the IdexVec IMO.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2fc4795): comparison URL. Overall result: ✅ improvements - no 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. @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)ResultsThis 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.
CyclesResultsThis 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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.867s -> 668.905s (0.01%) |
This looks similar to SortedMap. Using that might simplify the code. |
fb14cf7
to
f388f23
Compare
another experiment: remove undo log |
This comment has been minimized.
This comment has been minimized.
use Vec for region constraints instead of BTreeMap ~1% perf gain Diagnostic regressions need more investigation. r? `@ghost`
@michaelwoerister A downside is that it incurs a perf penalty for every insert operation when in practice most inserted region constraints end up being removed either by rolling back to a previous snapshot or by ignoring region resolution entirely. |
Ah OK, that makes sense! |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (e499e7a): 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)ResultsThis 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.
CyclesResultsThis 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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.135s -> 670.525s (-0.24%) |
f388f23
to
8c215e7
Compare
I reverted the UndoLog experiment, so this is no longer a perf regression as per the original perf run. The diagnostic regression is fixed by the last commit. r? compiler |
@@ -4,8 +4,8 @@ error[E0308]: mismatched types | |||
LL | assert_all::<_, &String>(id); | |||
| ^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other | |||
| | |||
= note: expected reference `&String` | |||
found reference `&String` | |||
= note: expected trait `for<'a> <for<'a> fn(&'a String) -> &'a String {id} as FnMut<(&'a String,)>>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's the second commit.
@bors r+ |
…r-errors use Vec for region constraints instead of BTreeMap ~1% perf gain Diagnostic regressions need more investigation. r? `@ghost`
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Unrelated @bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d6d7a93): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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)ResultsThis 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.
CyclesResultsThis 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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 674.597s -> 672.389s (-0.33%) |
Stop sorting via `DefId`s in region resolution hopefully maintains the perf improvement from rust-lang#118824 works towards rust-lang#90317
…ichaelwoerister Stop sorting via `DefId`s in region resolution hopefully maintains the perf improvement from rust-lang#118824 works towards rust-lang#90317
~1% perf gain
Diagnostic regressions need more investigation.
r? @ghost