Skip to content

Add a cache to speed up the parser #586

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...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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