Skip to content

Optimizes parsing of large non-UTF8 queries #112

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

Conversation

NeedleInAJayStack
Copy link
Member

While this doesn't impact UTF8 strings built up in Swift, Strings decoded from data (like through Vapor, for example) may not be marked as UTF8, which makes the lexer UTF8 conversions very expensive. In evaluation of 450kb requests, performance improved from 27min to 5sec with this adjustment.

@NeedleInAJayStack NeedleInAJayStack force-pushed the feature/large-query-parsing-performance branch from f69880c to 1c239c0 Compare November 6, 2022 03:26
While this doesn't impact UTF8 strings built up in Swift, Strings decoded from random data (like through Vapor, for example) may not be marked as UTF8, which makes the lexer UTF8 conversions very expensive. In evaluation of 450kb requests, performance improved from 27min to 5sec.
@NeedleInAJayStack NeedleInAJayStack force-pushed the feature/large-query-parsing-performance branch from 1c239c0 to a982b62 Compare November 6, 2022 03:39
@NeedleInAJayStack
Copy link
Member Author

Hey @paulofaria, do you have any concerns about this one? It should be a quick review.

Copy link
Member

@paulofaria paulofaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay!

@NeedleInAJayStack
Copy link
Member Author

No worries, thanks for the review!

@NeedleInAJayStack NeedleInAJayStack merged commit ad4a715 into GraphQLSwift:main Nov 8, 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.

2 participants