Skip to content

running PHP-Parser over laravell shows some perf bottleneck #1154

Description

@staabm

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions