-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add zstd compression support to SAPM client (#138)
I added a simple benchmark of compression methods and a test to print compressed byte sizes. Take with a grain of salt since the input is based on just one trivial data generator and may not be representative of production loads. For the inputs used zstd wins both in compression size and speed (more apparent in larger input sizes). ## Compression Sizes ``` === RUN TestCompressionSize Message byte size by batch and compression method. Compression none gzip zstd Batch=1 148 139 135 Batch=10 1558 503 490 Batch=100 15958 2495 2360 Batch=1000 161590 22110 22978 Batch=10000 1644106 222217 181468 --- PASS: TestCompressionSize (0.13s) ``` ## Benchmark ``` BenchmarkCompression/none/batch=1-8 56662 85501 ns/op 233172 B/op 28 allocs/op BenchmarkCompression/gzip/batch=1-8 27688 64055 ns/op 117560 B/op 35 allocs/op BenchmarkCompression/zstd/batch=1-8 41965 69071 ns/op 174616 B/op 33 allocs/op BenchmarkCompression/none/batch=100-8 20131 63991 ns/op 117124 B/op 325 allocs/op BenchmarkCompression/gzip/batch=100-8 3043 408736 ns/op 54255 B/op 335 allocs/op BenchmarkCompression/zstd/batch=100-8 10276 120161 ns/op 80178 B/op 330 allocs/op BenchmarkCompression/none/batch=1000-8 3066 382949 ns/op 323067 B/op 3025 allocs/op BenchmarkCompression/gzip/batch=1000-8 243 4787768 ns/op 379947 B/op 3038 allocs/op BenchmarkCompression/zstd/batch=1000-8 1128 1014972 ns/op 391926 B/op 3034 allocs/op ```
- Loading branch information
1 parent
6c867a0
commit 755ac0a
Showing
9 changed files
with
312 additions
and
96 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
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
Oops, something went wrong.