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

s2: Improve coding for long, close matches #613

Merged
merged 2 commits into from
Jun 2, 2022
Merged

Conversation

klauspost
Copy link
Owner

@klauspost klauspost commented Jun 2, 2022

Use one less byte when emitting copies that are >64 and offset <2048

Before we emit 60 bytes (3 byte encoding) and remaining as repeat. Now we emit 8 bytes (2 byte encoding) + repeat. Repeat may in rare cases eat back the saved byte, but it is never worse.

before -> after:

consensus.db.10gb: 4244773384 -> 4228831520
nyc-taxi-data-10M.csv: 779098746 -> 776295996
github-june-2days-2019.json: 832855431 -> 831242779
github-ranks-backup.bin: 554428594 -> 554340949

Typically 0.1% improvement.

Use one less byte when emitting copies that are >64 and offset <2048

consensus.db.10gb: 4244773384 -> 4228831520
nyc-taxi-data-10M.csv: 779098746 -> 776295996
github-june-2days-2019.json: 832855431 -> 831242779
github-ranks-backup.bin: 554428594 -> 554340949
@klauspost klauspost merged commit 72cae76 into master Jun 2, 2022
@klauspost klauspost deleted the s2-improve-coding branch June 2, 2022 17:43
@klauspost klauspost changed the title s2: Improve coding for close matches s2: Improve coding for long, close matches Jun 3, 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.

None yet

1 participant