Skip to content

Conversation

leebyron
Copy link
Contributor

This provides a performance improvement and simplification to the validator by providing two new generic visitor utilities. One for tracking a TypeInfo instance alongside a visitor instance, and another for stepping through multiple visitors in parallel. The two can be composed together.

Rather than 23 passes of AST visitation with one rule each, this now performs one pass of AST visitation with 23 rules. Since visitation is costly but rules are inexpensive, this nets out to a much faster overall validation, especially noticeable for very large queries.

On an internal very large query validation stress-test saw ~ 4-5x performance improvement.

This fixes #211

This provides a performance improvement and simplification to the validator by providing two new generic visitor utilities. One for tracking a TypeInfo instance alongside a visitor instance, and another for stepping through multiple visitors in parallel. The two can be composed together.

Rather than 23 passes of AST visitation with one rule each, this now performs one pass of AST visitation with 23 rules. Since visitation is costly but rules are inexpensive, this nets out to a much faster overall validation, especially noticable for very large queries.
leebyron added a commit that referenced this pull request Nov 17, 2015
[Validation] Parallelize validation rules.
@leebyron leebyron merged commit 81e7596 into master Nov 17, 2015
@leebyron leebyron deleted the parallel-validator branch November 17, 2015 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] More efficient ValidationVisitor implementation

2 participants