Make region_scope_tree a tcx method#154463
Make region_scope_tree a tcx method#154463zetanumbers wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Please run perf, I expect some improvements. |
|
@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.
Make region_scope_tree a tcx method
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (5326cba): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never 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.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 483.294s -> 491.715s (1.74%) |
Actually serde_derive only benefits for incremental scenarios, which rarely not happen in practice since crate dependencies are built non-incrementally either way. I think maybe we shouldn't merge this. |
|
☔ The latest upstream changes (presumably #154466) made this pull request unmergeable. Please resolve the merge conflicts. This pull request was unapproved. |
| /// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body; | ||
| /// in the case of closures, this will be redirected to the enclosing function. | ||
| query region_scope_tree(def_id: DefId) -> &'tcx crate::middle::region::ScopeTree { | ||
| /// Do not call directly! It's query implementation for method |
There was a problem hiding this comment.
I would call it directly in cases where the caller already has a typeck root.
Continuing on #154304.
Currently
region_scope_treequery itself callstcx.region_scope_tree(tcx.typeck_root_def_id(key))if its key isn't a type-check root. I thought this might be an overhead and made region_scope_tree a tcx method which calls region_scope_tree_root query instead.