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

Improve performance of response encoding for jsoniter #2330

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

kyri-petrou
Copy link
Collaborator

GraphQL field names (which are used as keys in the JSON object) need to be one of the following: _0-9A-Za-z. Since none of these characters require escaping, we can use the much more efficient writeNonEscapedAsciiKey method when writing object keys.

This seems to improve performance by ~5-10% for encoding responses based on our benchmarks. Weirdly enough, it seems that Scala 3 benefits much more than Scala 2 from this improvement 🤔

@ghostdogpr ghostdogpr merged commit 044d6c6 into series/2.x Jul 8, 2024
10 checks passed
@ghostdogpr ghostdogpr deleted the improve-jsoniter-encoding-performance branch July 8, 2024 00:25
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