Use correct buffer size for benchmark
This commit is contained in:
parent
4fd8222da6
commit
be03a31bdd
1 changed files with 1 additions and 2 deletions
|
@ -156,12 +156,11 @@ func BenchmarkEncrypt(b *testing.B) {
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
b.SetBytes(int64(size))
|
b.SetBytes(int64(size))
|
||||||
|
|
||||||
buf := restic.GetChunkBuf("BenchmarkEncrypt")
|
buf := make([]byte, len(data)+restic.CiphertextExtension)
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
_, err := k.Encrypt(buf, data)
|
_, err := k.Encrypt(buf, data)
|
||||||
ok(b, err)
|
ok(b, err)
|
||||||
}
|
}
|
||||||
restic.FreeChunkBuf("BenchmarkEncrypt", buf)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkDecryptReader(b *testing.B) {
|
func BenchmarkDecryptReader(b *testing.B) {
|
||||||
|
|
Loading…
Reference in a new issue