Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust graphql parser #76

Closed
wants to merge 4 commits into from
Closed

Rust graphql parser #76

wants to merge 4 commits into from

Conversation

kindermax
Copy link
Collaborator

PoC - reimplement graphql query parsing in rust.

Comparing:

  • python parsing with graphql-core (original)
  • rust parsing + converting rust ast into graphql-core ast - (so we do not need to rewrite core which works with graphql-core ast)
  • rust parsing but w/o converting rust ast into py ast (using mocked py ast for simple query)
  • just mocked py ast (no parsing at all)

Comparing these four situations allows to see what part of flow is actually slow.

image

Here we see that rust_real vs rust_mock shows that parsing and converting rust ast into graphql ast almost 2x slower than just parsing rust ast and return mocked graphql ast (skipping AstConverter part)

The goal is to show if rust parser is suitable in this case.

@kindermax kindermax force-pushed the rust-graphql-parser branch 2 times, most recently from 28024af to 78b91d3 Compare August 14, 2022 15:50
@kindermax
Copy link
Collaborator Author

As an alternative, a simple lru-based ast cache was added. If queries do not change too often and do not use inline variables, ast cache must to be very efficient.

@kindermax kindermax closed this Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant