Created
September 19, 2016 17:48
-
-
Save fd0/908c23123dda275a479cf931f2784f5d to your computer and use it in GitHub Desktop.
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
package main | |
import ( | |
"crypto/rand" | |
"io" | |
"testing" | |
) | |
func BenchmarkCompressibility(b *testing.B) { | |
buf := make([]byte, 8*1024*1024) | |
_, err := io.ReadFull(rand.Reader, buf) | |
if err != nil { | |
b.Fatal(err) | |
} | |
b.ResetTimer() | |
b.SetBytes(int64(len(buf))) | |
for i := 0; i < b.N; i++ { | |
compressibility(buf) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment