Skip to content

JSON encoding speedups#647

Merged
jcrist merged 4 commits intomainfrom
encoder-cleanups
Feb 23, 2024
Merged

JSON encoding speedups#647
jcrist merged 4 commits intomainfrom
encoder-cleanups

Conversation

@jcrist
Copy link
Copy Markdown
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
@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