From 02bec13ef2ea9d1c89d1cbf7db9977116bbc0714 Mon Sep 17 00:00:00 2001 From: greatroar <@> Date: Sun, 28 Jun 2020 17:15:26 +0200 Subject: [PATCH] Fix repository_test.BenchmarkSaveAndEncrypt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The benchmark was actually testing the speed of index lookups. name old time/op new time/op delta SaveAndEncrypt-8 101ns ± 2% 31505824ns ± 1% +31311591.31% (p=0.000 n=10+10) name old speed new speed delta SaveAndEncrypt-8 41.7TB/s ± 2% 0.0TB/s ± 1% -100.00% (p=0.000 n=10+10) name old alloc/op new alloc/op delta SaveAndEncrypt-8 1.00B ± 0% 20989508.40B ± 0% +2098950740.00% (p=0.000 n=10+10) name old allocs/op new allocs/op delta SaveAndEncrypt-8 0.00 123.00 ± 0% +Inf% (p=0.000 n=10+9) (The actual speed is ca. 131MiB/s.) --- internal/repository/repository_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/repository/repository_test.go b/internal/repository/repository_test.go index 5d275b4e6..62d1c0d30 100644 --- a/internal/repository/repository_test.go +++ b/internal/repository/repository_test.go @@ -107,8 +107,7 @@ func BenchmarkSaveAndEncrypt(t *testing.B) { t.SetBytes(int64(size)) for i := 0; i < t.N; i++ { - // save - _, _, err = repo.SaveBlob(context.TODO(), restic.DataBlob, data, id, false) + _, _, err = repo.SaveBlob(context.TODO(), restic.DataBlob, data, id, true) rtest.OK(t, err) } }