Uh oh!
There was an error while loading. Please reload this page.
Store tokens inside ast::Expr - #72287
Conversation
This comment has been minimized.
This comment has been minimized.
Aaron1011
commented
May 17, 2020
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
May 17, 2020
Finished benchmarking try commit 2728275cf62b7f7bfb2bbc99674bd8476722477a, comparison URL. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
May 17, 2020
Not sure why there's such slowdown, absolute majority of expressions doesn't have attributes. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
May 18, 2020
Finished benchmarking try commit 11e2f20befcdd9b10073fe96ba2e880ac822352d, comparison URL. |
72b44ee to
4855363CompareAaron1011
commented
May 19, 2020
Let's make sure that my new @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
May 20, 2020
Finished benchmarking try commit 7bc7cfa40f58523836318ebc43f17436ce067963, comparison URL. |
Uh oh!
There was an error while loading. Please reload this page.
estebank
commented
May 20, 2020
FWIW, the code looks mergeable and I'm really excited about the UX improvement. |
4855363 to
d5a2dbeComparepetrochenkov
commented
May 20, 2020
I'll review this in detail ~tomorrow, but from a cursory view the collecting mechanism change in |
@petrochenkov: I opened #72393 with just the |
petrochenkov
commented
May 21, 2020
Blocked on #72393. |
…okens, r=petrochenkov Rewrite `Parser::collect_tokens` The previous implementation did not work when called on an opening delimiter, or when called re-entrantly from the same `TokenCursor` stack depth. I'm not sure how to test this apart from rust-lang#72287
…okens, r=petrochenkov Rewrite `Parser::collect_tokens` The previous implementation did not work when called on an opening delimiter, or when called re-entrantly from the same `TokenCursor` stack depth. I'm not sure how to test this apart from rust-lang#72287
This comment has been minimized.
This comment has been minimized.
d5a2dbe to
14382c6CompareAaron1011
commented
May 24, 2020
@petrochenkov: Rebased |
petrochenkov
commented
May 24, 2020
@bors r+ |
bors
commented
May 24, 2020
📌 Commit 14382c6 has been approved by |
bors
commented
May 24, 2020
bors
commented
May 25, 2020
☀️ Test successful - checks-azure |
This is a smaller version of #70091.
We now store captured tokens inside
ast::Expr, which allows us to avoid some reparsing innt_to_tokenstream. To try to mitigate the performance impact, we only collect tokens when we've seen an outer attribute.This makes progress towards solving #43081. There are still many things left to do:
#[cfg]attr is used.However, this is enough to fix spans for a simple example, which I've included as a test case.