[1.0] Replace NodeConnectingVisitor with ParentConnectingVisitor#3900
[1.0] Replace NodeConnectingVisitor with ParentConnectingVisitor#3900TomasVotruba merged 5 commits intomainfrom
Conversation
|
using [ci skip] commit message to skip the rectify for now, while wait for all next/prev node usage removed. |
|
@TomasVotruba This require PR: to be merged first for last |
|
I guess it would make sense to make some before/after measurements regarding memory and time for this PR |
| public const PARENT_NODE = 'parent'; | ||
|
|
||
| /** | ||
| * @api |
There was a problem hiding this comment.
even if the keys exist the attributes will no longer exist right?
do we need some kind of "bc preserving" mode which registers the NodeConnectingVisitor instead of ParentConnectingVisitor ?
in phpstan this is implemented via bleeding-edge
There was a problem hiding this comment.
This is rather to keep changes as small as possible. First replace logic, then remove constants in next PR.
|
@staabm Could you check the metrics before and after this PR e.g .on |
|
sure. just go ahead - I can do it even after the merge. |
|
@staabm Thank you 👍 Let's ship it! Thanks @samsonasik for handling the upgrade path step step. |
|
I did some measues in disabled parallel (for easier reproducability; more meaningful results) on the following command: before after My interpretation
-> I think garbage collection is still hurt by the parent-node attributes, as I would expect way less memory when our optimization really make garbage collection more efficient |
run it with `time php bin/rector --dry-run --clear-cache --debug -vvv` compare results with rectorphp#3900 (comment)
run it with `time php bin/rector --dry-run --clear-cache --debug -vvv` compare results with rectorphp#3900 (comment)
run it with `time php bin/rector --dry-run --clear-cache --debug -vvv` compare results with rectorphp#3900 (comment)
run it with `time php bin/rector --dry-run --clear-cache --debug -vvv` compare results with rectorphp#3900 (comment)
@TomasVotruba @staabm
parentattribute can be reduced, but seems can't be removed completely to resolve Scope.This to be
ParentConnectingVisitorand removeNodeConnectingVisitorwhen all prev and next node attribute removed.