-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inflate: Read more bits when decoding (#232)
When a block is not marked as the final block it should be possible to read 10 further bits ahead without breaking the promise of not overreading. Fixes #231 Also write blocks with only EOF as TYPE 01 (predefined tables) with only an EOB literal. This saves 3-4 bytes at no cost. The smallest block seems to be a predefined block with a single EOB, which would be 10 bits + EOB from current block (current limit). This should make it possible to fill more bits at the time when decoding. ``` λ benchcmp old.txt new.txt benchmark old ns/op new ns/op delta BenchmarkGunzipCopy-12 27830317 26617762 -4.36% BenchmarkGunzipNoWriteTo-12 27878505 26705660 -4.21% benchmark old MB/s new MB/s speedup BenchmarkGunzipCopy-12 171.50 179.31 1.05x BenchmarkGunzipNoWriteTo-12 171.20 178.72 1.04x ```
- Loading branch information
Showing
4 changed files
with
66 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters