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

Optimize XOR floating point compression #171

Merged
merged 6 commits into from
Apr 2, 2024
Merged

Optimize XOR floating point compression #171

merged 6 commits into from
Apr 2, 2024

Conversation

cswinter
Copy link
Owner

@cswinter cswinter commented Apr 1, 2024

Now achieves up to 390MiB/s encode, 1050MiB/s decode on random [0, 1] double precision values. Encode up to 415MiB/s for doubles created as [0, 1] single precision values.

Main changes:

  • sub out simple BitWriter/BitReader implementations for https://github.com/icewind1991/bitbuffer, this is where majority of speed gain comes from.
  • perform a single 2 bit write for the 10 and 11 control codes rather than two 1 bit writes (~40% speedup)
  • when decoding, pre-allocate entire Vec and replace push with direct write. (~15% speedup)

@cswinter cswinter merged commit 59945ab into master Apr 2, 2024
4 checks passed
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