resolve/expand: Cache intermediate results of #[derive] expansion#82907
resolve/expand: Cache intermediate results of #[derive] expansion#82907bors merged 2 commits intorust-lang:masterfrom
#[derive] expansion#82907Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit 45589d2e6e7af5866c804666bf52cbc0e671c2d5 with merge cc63cfbd3047bd17037ca21fa2ac23c7abfe4600... |
|
☀️ Try build successful - checks-actions |
|
Queued cc63cfbd3047bd17037ca21fa2ac23c7abfe4600 with parent 1d6b0f6, future comparison URL. |
|
Finished benchmarking try commit (cc63cfbd3047bd17037ca21fa2ac23c7abfe4600): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
|
The results are within the noise, but I'd still like to land this as a refactoring, because it will help with another caching-related FIXME in |
This comment has been minimized.
This comment has been minimized.
|
It's been almost a month. |
|
Updated. |
|
@bors r+ |
|
📌 Commit b965844 has been approved by |
|
⌛ Testing commit b965844 with merge 284954f5b9a7702c697585ee899ef91f68ac4dc1... |
|
Spurious failure |
|
💔 Test failed - checks-actions |
|
☀️ Test successful - checks-actions |
Expansion function for
#[derive](rustc_builtin_macros::derive::Expander::expand) may return an indeterminate result, and therefore can be called multiple times.Previously we parsed the
#[derive(Foo, Bar)]'s input and tried to resolveFooandBaron every such call.Now we maintain a cache
Resolver::derive_dataand take all the necessary data from it if it was computed previously.So
Foo, Baris now parsed at most once, andFooandBarare successfully resolved at most once.