aboutsummaryrefslogtreecommitdiff
path: root/internal/cryptocore/randprefetch_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cryptocore/randprefetch_test.go')
-rw-r--r--internal/cryptocore/randprefetch_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/cryptocore/randprefetch_test.go b/internal/cryptocore/randprefetch_test.go
index 2a568f3..b263ef3 100644
--- a/internal/cryptocore/randprefetch_test.go
+++ b/internal/cryptocore/randprefetch_test.go
@@ -38,3 +38,11 @@ func TestRandPrefetch(t *testing.T) {
t.Errorf("random data should be incompressible, but: in=%d compressed=%d\n", p*l*l, b.Len())
}
}
+
+func BenchmarkRandPrefetch(b *testing.B) {
+ // 16-byte nonces are default since gocryptfs v0.7
+ b.SetBytes(16)
+ for i := 0; i < b.N; i++ {
+ randPrefetcher.read(16)
+ }
+}