phpstan-dba
phpstan-dba copied to clipboard
Reduce use of PreviousConnectingVisitor:: ATTRIBUTE_PARENT to assist garbage collector
idea is to have less Ast\Nodes with a pointer to the parent node, so the garbage collector has a easier job identifying unused nodes and clear memory. for our use-case its enough to know parents within functions/method bodies.
refs https://github.com/staabm/phpstan-dba/issues/667
in the long run it would be best to get rid of PreviousConnectingVisitor but I am currently not deep enough into the details of this lib todo such refactoring right now
Thank you for looking into this already. I run latest stable and this branch with GC enabled and disabled. Looks like there is a slight improvement when gc is disabled. Unfortunately, the regular run got a lot worse.
| php ./bin/phpstan | php -d zend.enable_gc=0 ./bin/phpstan | |
|---|---|---|
| 0.2.8.1 | 9:04.60 | 3:01.07 |
| less-parents | 13:31.71 | 2:57.27 |
All good if there is no easy solution available at the moment. We can disable gc in our CI build for now. If you ever need to let me run anything then just let me know!