Description
What is the problem?
Profiling shows the majority of the CPU time increase when taking an encrypted backup is from rand.Read when generating a nonce. If we improve this the throughput should improve
What is the solution?
A couple of ideas:
- Rather than generating a single nonce at a time we could generate a bunch and advance through the list. Once there were none left we could synchronously generate more
- Generate nonces asynchronously on another thread. Allow a buffer so ideally there is always one ready