New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor use import resolving #4998
Conversation
@samsonasik do you have an idea what I missed? |
it may be an infinite loop somewhere |
Yep, the "operation canceled" usually means infinite loop. E.g. traversing nested nodes or calling 2 methods back and forth. |
this looks good now. I will update the PR description after merge, because atm I cannot measure the perf diff before-merge in the codeigniter codebase |
@@ -45,9 +46,14 @@ public function resolveFromStmts(array $stmts): array | |||
$aliasedUses = []; | |||
|
|||
$this->useImportsTraverser->traverserStmts($stmts, static function ( | |||
int $useType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add enum param doc type here? I think it's Use_::TYPE_*
$this->useImportsTraverser->traverserStmts($stmts, static function ( | ||
int $useType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this:
$this->useImportsTraverser->traverserStmts($stmts, static function ( | |
int $useType, | |
/** @param Use_::TYPE_* $useType */ | |
$this->useImportsTraverser->traverserStmts($stmts, static function ( | |
int $useType, |
Thank you 👏 |
@TomasVotruba @staabm I tried in CodeIgniter 4 project, it now very very slow, it got 2 times slower now. |
@TomasVotruba @staabm hm.., I am investigating, it probably on my local dev that installing php extensions that make cli slower:
I will try uninstall them and re-try |
Maybe you have xdebug or something like that enabled? |
@staabm just verify, uninstalling |
probably related with imap extension asked 9 years ago https://serverfault.com/questions/586141/php-cli-with-imap-5-second-startup-delay which parallel open new 127.0.0.1 tcp server. |
followup to #4994
reduce duplicate node traversal of the same nodes over and over again