summaryrefslogtreecommitdiff
path: root/internal/cryptocore/randprefetch.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-08-16 18:33:00 +0200
committerJakob Unterwurzacher2017-08-16 18:33:00 +0200
commit312ea32bb70abb93be315d0b7c442d5c4ae571d9 (patch)
tree31c7b91db06bf208a6d44dae0058171dd6735b80 /internal/cryptocore/randprefetch.go
parent838bf883df579a414289a3e05d238c582ac78523 (diff)
cryptocore: add urandom + randprefetch benchmarks
The benchmark that supported the decision for 512-byte prefetching previously lived outside the repo. Let's add it where it belongs so it cannot get lost.
Diffstat (limited to 'internal/cryptocore/randprefetch.go')
-rw-r--r--internal/cryptocore/randprefetch.go17
1 files changed, 3 insertions, 14 deletions
diff --git a/internal/cryptocore/randprefetch.go b/internal/cryptocore/randprefetch.go
index 081559d..0cde31d 100644
--- a/internal/cryptocore/randprefetch.go
+++ b/internal/cryptocore/randprefetch.go
@@ -6,20 +6,9 @@ import (
"sync"
)
-/*
-Number of bytes to prefetch.
-
-512 looks like a good compromise between throughput and latency:
-Benchmark16-2 3000000 567 ns/op 28.18 MB/s
-Benchmark64-2 5000000 293 ns/op 54.51 MB/s
-Benchmark128-2 10000000 220 ns/op 72.48 MB/s
-Benchmark256-2 10000000 210 ns/op 76.17 MB/s
-Benchmark512-2 10000000 191 ns/op 83.75 MB/s
-Benchmark1024-2 10000000 171 ns/op 93.48 MB/s
-Benchmark2048-2 10000000 165 ns/op 96.45 MB/s
-Benchmark4096-2 10000000 165 ns/op 96.58 MB/s
-Benchmark40960-2 10000000 147 ns/op 108.82 MB/s
-*/
+// Number of bytes to prefetch.
+// 512 looks like a good compromise between throughput and latency - see
+// randsize_test.go for numbers.
const prefetchN = 512
func init() {