The service used to do a linear scan for the lowest counter value in its cross-off list, in order to expire that value. This took about 3ms. I added a heap to make finding the lowest value more efficient. Now, redeeming a nonce takes about 3μs. ``` benchmark old ns/op new ns/op delta BenchmarkNonces-4 1597950 5100 -99.68% ``` Fixes #1219. |
||
---|---|---|
.. | ||
nonce.go | ||
nonce_test.go |