Skip to content

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.

klauspost added 2 commits June 2, 2022 18:09
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.

2 participants