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: Search at match end in best mode #358

Merged
merged 1 commit into from
Apr 21, 2021
Merged

Conversation

klauspost
Copy link
Owner

@klauspost klauspost commented Apr 21, 2021

When we have a potential match, see if we can find a better one by searching the offset at of the first 8 mismatched bytes.

Improves compression for all cases.

Before/after pairs:

Reading nyc-taxi-data-10M.csv...
Compressing... 3325605752 -> 786648492 [23.65%]; 7.517s, 421.9MB/s
Compressing... 3325605752 -> 779098746 [23.43%]; 8.29s, 382.6MB/s

Reading adresser.json...
Compressing... 7983034785 -> 380912248 [4.77%]; 3.924s, 1940.0MB/s
Compressing... 7983034785 -> 372523343 [4.67%]; 4.34s, 1754.1MB/s

Reading 10gb.tar...
Compressing... 10065157632 -> 5215462149 [51.82%]; 29.462s, 325.8MB/s
Compressing... 10065157632 -> 5208719802 [51.75%]; 32.78s, 292.8MB/s

Reading enwik9...
Compressing... 1000000000 -> 373289535 [37.33%]; 4.047s, 235.6MB/s
Compressing... 1000000000 -> 371710958 [37.17%]; 4.513s, 211.3MB/s

Reading sample.tar...
Compressing... 808796160 -> 277822539 [34.35%]; 2.043s, 377.5MB/s
Compressing... 808796160 -> 277741541 [34.34%]; 2.407s, 320.4MB/s

When we have a potential match, see if we can find a better one by searching the offset at of the first 8 mismatched bytes.

Improves compression for all cases.

Before/after pairs:
```
Reading nyc-taxi-data-10M.csv...
Compressing... 3325605752 -> 786648492 [23.65%]; 7.517s, 421.9MB/s
Compressing... 3325605752 -> 779098746 [23.43%]; 8.29s, 382.6MB/s

Reading adresser.json...
Compressing... 7983034785 -> 380912248 [4.77%]; 3.924s, 1940.0MB/s
Compressing... 7983034785 -> 372523343 [4.67%]; 4.34s, 1754.1MB/s

Reading 10gb.tar...
Compressing... 10065157632 -> 5215462149 [51.82%]; 29.462s, 325.8MB/s
Compressing... 10065157632 -> 5208719802 [51.75%]; 32.78s, 292.8MB/s

Reading enwik9...
Compressing... 1000000000 -> 373289535 [37.33%]; 4.047s, 235.6MB/s
Compressing... 1000000000 -> 371710958 [37.17%]; 4.513s, 211.3MB/s

Reading sample.tar...
Compressing... 808796160 -> 277822539 [34.35%]; 2.043s, 377.5MB/s
Compressing... 808796160 -> 277710349 [34.34%]; 2.409s, 320.2MB/s
```
@klauspost klauspost merged commit e3ae23b into master Apr 21, 2021
@klauspost klauspost deleted the s2-search-match-end branch April 21, 2021 15:16
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