Uh oh!
There was an error while loading. Please reload this page.
Remove some unnecessary indirection from AST/HIR structures - #30087
Conversation
nrc
commented
Nov 28, 2015
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 |
eddyb
commented
Nov 28, 2015
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. |
petrochenkov
commented
Nov 28, 2015
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. |
Manishearth
commented
Nov 29, 2015
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. |
bors
commented
Dec 4, 2015
☔ The latest upstream changes (presumably #29850) made this pull request unmergeable. Please resolve the merge conflicts. |
petrochenkov
commented
Dec 4, 2015
Rebased. |
nrc
commented
Dec 6, 2015
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. |
petrochenkov
commented
Dec 6, 2015
There is such a PR! #29850 landed two days ago. (It is the reason why I had to rebase this PR as well) |
nrc
commented
Dec 6, 2015
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. |
Manishearth
commented
Dec 7, 2015
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
commented
Dec 7, 2015
Updated with AST changes reverted. |
nrc
commented
Dec 7, 2015
@bors: r+ |
bors
commented
Dec 7, 2015
📌 Commit ca88e9c has been approved by |
bors
commented
Dec 7, 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 `enum`s are not affected. r? @nrc I wonder if AST/HIR visitors could run faster if `P`s are systematically removed (except for cases where they control `enum` sizes). Theoretically they should. Remaining unnecessary `P`s can't be easily removed because many folders accept `P<X>`s as arguments, but these folders can be converted to accept `X`s 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 `P`s and measure again.
bors
commented
Dec 8, 2015
cc #31487 plugin-[breaking-change] The AST part of #30087 r? @Manishearth
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.