Skip to content

[RFC] More efficient ValidationVisitor implementation #211

@jhgg

Description

@jhgg

For the ValidationVisitor, in graphql-core I had implemented it in a slightly different way. Running each ValidationVisitor as it walks the AST, instead of walking the AST 22 times.

https://github.com/graphql-python/graphql-core/blob/master/graphql/core/validation/visitor.py

So far, it's been working perfectly. All tests pass without issue, and it looks like running validation runs quite a bit faster too. I didn't do any perf benchmarks comparing them, but the unit tests ran like 30% faster with the new implementation. :O

I could open a PR porting this to graphql-js if interested.

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