-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use faster gzip package Before: ``` BenchmarkCompression/gzip/compress-32 81 13573535 ns/op 8.77 MB/s 10115 B/op 1 allocs/op BenchmarkCompression/gzip/decompress-32 580 2023225 ns/op 959.10 MB/s 7563 B/op 53 allocs/op gzip: 93.86% ``` After: ``` BenchmarkCompression/gzip/compress-32 224 5340019 ns/op 24.42 MB/s 4838 B/op 1 allocs/op BenchmarkCompression/gzip/decompress-32 692 1713771 ns/op 1132.28 MB/s 566 B/op 34 allocs/op gzip: 93.28% ```` Pretty typical scenario for default settings, 2-3x faster, sometimes at a slight compression loss. This provides a much better "default" trade-off than the stdlib. For people regretting the 0.6% loss the higher compression levels can be used. Decompression typically has even bigger margin, but it depends on the input. * Use gz as import alias.
- Loading branch information
Showing
5 changed files
with
10 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package gzip | ||
|
||
import ( | ||
"compress/gzip" | ||
"io" | ||
"sync" | ||
|
||
"github.com/klauspost/compress/gzip" | ||
) | ||
|
||
var ( | ||
|
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