Skip to content

Add a cache to speed up the parser #586

@fain182

Description

@fain182

Class parsing takes up 90% of the time, so having a cache could radically change performance.

Following @micheleorselli 's suggestion, something similar to what php-cs-fixer does might be enough: you serialize the ClassDescription and save it to a file, associating it with the hash of the file's content.
When you need to parse, you first compute the hash and look it up in the cache — if it's there, you hydrate the ClassDescription and skip parsing entirely.

One thing to watch out for: with inheritance support, a dependency's cache could become stale even if the individual file hasn't changed...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions