Cache flags for `ty::Const` by compiler-errors · Pull Request #118189 · rust-lan...
source link: https://github.com/rust-lang/rust/pull/118189
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Not sure if this has been attempted yet, but worth a shot. It does make the code simpler in rustc_type_ir
, since we can assume that consts have a flags
method that is no-cost.
r? @ghost
added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
labels
This comment has been minimized.
added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label
Contributor
☀️ Try build successful - checks-actions |
This comment has been minimized.
Collaborator
Finished benchmarking commit (d300094): 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)Results CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.896s -> 674.726s (-0.17%) |
removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label
Member
Author
cool beans r? @nnethercote you have any idea why this wasn't attempted sooner? i may be missing some history/background of |
There are likely other folders/visiting that could take advantage of the fact that consts have an O(1)
flag/outer_exclusive_binder computation, and short-circuit folding/visiting in this case. I'll leave that up to follow-ups.
@@ -28,10 +28,11 @@ impl FlagComputation { | ||
result |
||
} |
||
pub fn for_const(c: ty::Const<'_>) -> TypeFlags { |
||
pub fn for_const(c: &ty::ConstKind<'_>, t: Ty<'_>) -> FlagComputation { |
Maybe this should take &ConstData
?
self.add_exclusive_binder(c.outer_exclusive_binder()); |
||
} |
||
fn add_const_kind(&mut self, c: &ty::ConstKind<'_>) { |
I actually am unsure if it's more efficient just to take the ConstKind
by value here.
added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Contributor
☀️ Test successful - checks-actions |
Collaborator
Finished benchmarking commit (41fe75e): 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)Results CyclesResults Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.697s -> 676.001s (0.04%) |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK