libgocryptfs/internal/cryptocore
Jakob Unterwurzacher 80516ed335 cryptocore: prefetch nonces in 512-byte blocks
On my machine, reading 512-byte blocks from /dev/urandom
(same via getentropy syscall) is a lot faster in terms of
throughput:

Blocksize    Throughput
 16          28.18 MB/s
512          83.75 MB/s

For a single-threaded streaming write, this drops the CPU usage of
nonceGenerator.Get to almost 1/3:

        flat  flat%   sum%        cum   cum%
Before     0     0% 95.08%      0.35s  2.92%  github.com/rfjakob/gocryptfs/internal/cryptocore.(*nonceGenerator).Get
After  0.01s 0.092% 92.34%      0.13s  1.20%  github.com/rfjakob/gocryptfs/internal/cryptocore.(*nonceGenerator).Get

This change makes the nonce reading single-threaded, which may
hurt massively-parallel writes.
2017-06-09 22:05:14 +02:00
..
cryptocore_test.go Add -forcedecode 2017-04-23 23:11:56 +02:00
cryptocore.go cryptocore: improve comments and add tests for hkdfDerive 2017-05-27 14:41:20 +02:00
hkdf_test.go cryptocore: improve comments and add tests for hkdfDerive 2017-05-27 14:41:20 +02:00
hkdf.go cryptocore: improve comments and add tests for hkdfDerive 2017-05-27 14:41:20 +02:00
nonce.go cryptocore: prefetch nonces in 512-byte blocks 2017-06-09 22:05:14 +02:00
randprefetch_test.go cryptocore: prefetch nonces in 512-byte blocks 2017-06-09 22:05:14 +02:00
randprefetch.go cryptocore: prefetch nonces in 512-byte blocks 2017-06-09 22:05:14 +02:00