#1154·PHP-Parser

running PHP-Parser over laravell shows some perf bottleneck

Author: staabmCreated Jul 8, 2026Updated Sep 6, 2026

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()
ImageImage

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

Image