in https://github.com/TomasVotruba/php-parser-speed-comparison-2026 there is a benchmark, which effictively installs laravel, removes some non-php files and parses all remaining 15961 PHP files (with the goal to compare different php parsers perf wise).
running the nikic/php-parser case thru blackfire reveals a interessting bottleneck:
see blackfire profile (link will be dead in 30 days I guess)
maybe there is something we can do about it
another interesting call is PHP8::getAttributes(), but I feel there is not much we can do about that
(maybe this method can be finalized in a future release, so we could inline its code within initReduceCallbacks)
this one is also interesting: maybe we can "inline these" PhpVersion specific calls, as the PHPVersion cannot change while parsing

in https://github.com/TomasVotruba/php-parser-speed-comparison-2026 there is a benchmark, which effictively installs laravel, removes some non-php files and parses all remaining 15961 PHP files (with the goal to compare different php parsers perf wise).
running the nikic/php-parser case thru blackfire reveals a interessting bottleneck:
String_::fromString()see blackfire profile (link will be dead in 30 days I guess)
maybe there is something we can do about it
another interesting call is
PHP8::getAttributes(), but I feel there is not much we can do about that(maybe this method can be
finalizedin a future release, so we could inline its code withininitReduceCallbacks)this one is also interesting: maybe we can "inline these"
PhpVersionspecific calls, as the PHPVersion cannot change while parsing