Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRemove some unnecessary indirection from AST/HIR structures #30087
Conversation
rust-highfive
assigned
nrc
Nov 27, 2015
This comment has been minimized.
This comment has been minimized.
|
The HIR changes seem like a no-brainer - r+. However, I'm wary about changing the AST and breaking a whole lot of code for no real gain - is there any motivation I'm missing or is this just tidying up? If the latter, I'd rather not change the AST. cc @eddyb who knows about P |
This comment has been minimized.
This comment has been minimized.
|
I should note that some (all?) of these are an artifact of @t and how the ast_map used to work (keeping shared boxes) - now they can disappear. |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure how much things it will break. I'm totally ready to revert the AST part, but I'd like to hear some more opinions, because cleanup is still an improvement, albeit modest. |
This comment has been minimized.
This comment has been minimized.
|
I think a bunch of Visitors might break. No biggie. Clippy would break, because we use Code using aster on nightly will probably break too (so, serde). Not sure how easy the upgrade is there. I'd expect some speed improvements here, surprised there aren't any. But I'm overall okay with this breakage. |
This comment has been minimized.
This comment has been minimized.
|
|
petrochenkov
force-pushed the
petrochenkov:indi
branch
from
47da574
to
951cee4
Dec 4, 2015
This comment has been minimized.
This comment has been minimized.
|
Rebased. |
This comment has been minimized.
This comment has been minimized.
|
It seems to me that @Manishearth's list of bustage is enough to justify not landing the AST parts. I'd like to land the HIR parts now but not the AST parts. I do think the AST changes are worthwhile though, and if there is a PR in the future which makes breaking changes to the AST, then perhaps this could be landed at the same time. |
This comment has been minimized.
This comment has been minimized.
There is such a PR! #29850 landed two days ago. (It is the reason why I had to rebase this PR as well) |
This comment has been minimized.
This comment has been minimized.
|
Ah, its a shame we didn't land them together. I think they have to land together (or at least to hit the same nightly) to get the benefit. |
This comment has been minimized.
This comment has been minimized.
|
Note that I'm mostly okay with clippy breaking on minor things like this if I know in advance, and can fix it up pretty much immediately. The existence of syntex makes things hard for us, though, since tiny public API changes still break compat when aster/etc are in the picture. Not sure how to handle that. |
petrochenkov
force-pushed the
petrochenkov:indi
branch
from
951cee4
to
ca88e9c
Dec 7, 2015
This comment has been minimized.
This comment has been minimized.
|
Updated with AST changes reverted. |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
petrochenkov commentedNov 27, 2015
I've measured the time/memory consumption before and after - the difference is lost in statistical noise, so it's mostly a code simplification.
Sizes of
enums are not affected.r? @nrc
I wonder if AST/HIR visitors could run faster if
Ps are systematically removed (except for cases where they controlenumsizes). Theoretically they should.Remaining unnecessary
Ps can't be easily removed because many folders acceptP<X>s as arguments, but these folders can be converted to acceptXs instead without loss of efficiency.When I have a mood for some mindless refactoring again, I'll probably try to convert the folders, remove remaining
Ps and measure again.