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

JSON encoding speedups #647

Merged
merged 4 commits into from
Feb 23, 2024
Merged

JSON encoding speedups #647

merged 4 commits into from
Feb 23, 2024

Conversation

jcrist
Copy link
Owner

@jcrist jcrist commented Feb 23, 2024

An assortment of micro-optimizations and cleanups around JSON encoding:

  • Accelerated int and float encoding by up to ~2x for small numbers
  • Accelerated datetime, date, and time encoding by ~30-40%
  • A few code cleanups to simplify the JSON encoder handlers

Previously we first encoded these into a small stack-allocated buffer,
then would `memcpy` over the results on success. We now encode directly
into the output buffer, avoiding the extra `memcpy`.

On small integers and floats this is up to 2x faster.
Initial benchmarks show speedups of ~30-40% across all temporal types.
@jcrist jcrist merged commit b44800c into main Feb 23, 2024
8 checks passed
@jcrist jcrist deleted the encoder-cleanups branch February 23, 2024 12:42
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.

1 participant