-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zstd: Skip random data 2x faster (#147)
If we did not get a single match in a full block, assume that the data cannot be entropy compressed. It is very likely that the data is random, and in the rare case it is not, we can live with it. Before: ``` BenchmarkRandomEncodeAllFastest-12 100 10475190 ns/op 1001.01 MB/s 0 B/op 0 allocs/op BenchmarkRandomEncodeAllDefault-12 100 11075653 ns/op 946.74 MB/s 0 B/op 0 allocs/op BenchmarkRandomEncoderFastest-12 200 8126950 ns/op 1290.25 MB/s 139 B/op 2 allocs/op BenchmarkRandomEncoderDefault-12 200 8059989 ns/op 1300.96 MB/s 90 B/op 2 allocs/op ``` After: ``` BenchmarkRandomEncodeAllFastest-12 300 4425967 ns/op 2369.15 MB/s 0 B/op 0 allocs/op BenchmarkRandomEncodeAllDefault-12 300 5108791 ns/op 2052.49 MB/s 0 B/op 0 allocs/op BenchmarkRandomEncoderFastest-12 300 5085627 ns/op 2061.84 MB/s 89 B/op 2 allocs/op BenchmarkRandomEncoderDefault-12 300 5947031 ns/op 1763.19 MB/s 65 B/op 2 allocs/op ```
- Loading branch information
Showing
3 changed files
with
115 additions
and
3 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