Skip to content
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

ast: Remove some indirection layers from values in key-value attributes #80441

Merged
merged 1 commit into from
Jan 10, 2021

Conversation

petrochenkov
Copy link
Contributor

Trying to address some perf regressions from #78837 (comment).

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 28, 2020
@petrochenkov petrochenkov added S-waiting-on-perf Status: Waiting on a perf run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 28, 2020
@petrochenkov
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@bors
Copy link
Contributor

bors commented Dec 28, 2020

⌛ Trying commit 4e34c7d7e884f56e81d2f73b969a4eafbbbd0355 with merge 702d7ce67a06c676371e5a9417e2172e3e0540f6...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment has been minimized.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 28, 2020
@petrochenkov
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@bors
Copy link
Contributor

bors commented Dec 28, 2020

⌛ Trying commit d29c28eee068bb08e02782975524e0de57defe7d with merge e3c34b4b68e99fdff4c3f40e35e9df57d62b0085...

@bors
Copy link
Contributor

bors commented Dec 28, 2020

☀️ Try build successful - checks-actions
Build commit: e3c34b4b68e99fdff4c3f40e35e9df57d62b0085 (e3c34b4b68e99fdff4c3f40e35e9df57d62b0085)

@rust-timer
Copy link
Collaborator

Queued e3c34b4b68e99fdff4c3f40e35e9df57d62b0085 with parent 76aca66, future comparison URL.

@rustbot label: +S-waiting-on-perf

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (e3c34b4b68e99fdff4c3f40e35e9df57d62b0085): 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 rollup- to bors.

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
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 28, 2020
@petrochenkov petrochenkov removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 28, 2020
@petrochenkov
Copy link
Contributor Author

r? @Aaron1011

@Aaron1011
Copy link
Member

@petrochenkov: Can you rebase against master?

@petrochenkov
Copy link
Contributor Author

Rebased.

@Aaron1011
Copy link
Member

r=me with the two comments addressed.

@petrochenkov
Copy link
Contributor Author

@bors r=Aaron1011

@bors
Copy link
Contributor

bors commented Jan 9, 2021

📌 Commit 71cd6f4 has been approved by Aaron1011

@bors bors 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 Jan 9, 2021
@bors
Copy link
Contributor

bors commented Jan 9, 2021

⌛ Testing commit 71cd6f4 with merge f30733a...

@bors
Copy link
Contributor

bors commented Jan 10, 2021

☀️ Test successful - checks-actions
Approved by: Aaron1011
Pushing f30733a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 10, 2021
@bors bors merged commit f30733a into rust-lang:master Jan 10, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 10, 2021
@rylev
Copy link
Member

rylev commented Jan 12, 2021

@petrochenkov @Aaron1011 It seems that this change caused some perf regressions. Given that the perf run you ran above yielded only positive results, this is likely due to some other change getting in before this landed that introduced perf gains which this PR subsequently reversed.

It looks like the largest perf hit was to the expand_crate query.

Additionally, it's not clear to me how this change helped addressed the original perf regression as the impacted benchmarks were not improved by this PR. Would you mind clarifying that?

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Jan 14, 2021

I'm ok with reverting this PR if it causes mixed results, I wouldn't say it brings any improvements besides the perf effect.

Additionally, it's not clear to me how this change helped addressed the original perf regression as the impacted benchmarks were not improved by this PR. Would you mind clarifying that?

#78837 introduced more indirection by boxing literals as interpolated expressions, this PR removed some indirection by keeping a single token instead of a Vec of tokens.
So these two indirection are located in different places, and may affect different tests differently, but I still hoped for them to counter-balance each other on average.

The ultimate solution to the regressions from #78837 is to keep AST on arena (like it's already done with HIR), so that no expressions are ever boxed. That would help not only expressions in key-value attributes, but all expressions in functions as well (which are in majority).

@petrochenkov petrochenkov mentioned this pull request Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants