2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-26 20:30:19 +00:00

Use correct buffer size for benchmark

This commit is contained in:
Alexander Neumann 2015-02-17 17:51:46 +01:00
parent 4fd8222da6
commit be03a31bdd

View File

@ -156,12 +156,11 @@ func BenchmarkEncrypt(b *testing.B) {
b.ResetTimer()
b.SetBytes(int64(size))
buf := restic.GetChunkBuf("BenchmarkEncrypt")
buf := make([]byte, len(data)+restic.CiphertextExtension)
for i := 0; i < b.N; i++ {
_, err := k.Encrypt(buf, data)
ok(b, err)
}
restic.FreeChunkBuf("BenchmarkEncrypt", buf)
}
func BenchmarkDecryptReader(b *testing.B) {