Chromium Code Reviews
DescriptionUse global rand.Rand instance in mathrand.
By default, mathrand will use a new *rand.Rand if none is installed in
the Context. This leads to a very bad performance case if the user
forgets to install an instance in the Context!
Now that we have locking, use a single global rand.Rand instance. The
user can always change this if they want. Update all of the global
functons to use our global interface instead of the rand.Rand package
one.
Additionally, as an optimization, remove "defer" calls from the Locking
wrapper. This speeds up operations by a factor of 3x.
BUG=chromium:675813
TEST=None
Review-Url: https://codereview.chromium.org/2588213002
Committed: https://github.com/luci/luci-go/commit/f469f2540cad71872c674950f530bdbc5de13e02
Patch Set 1 #
Total comments: 4
Patch Set 2 : Global rand, remove defers #Patch Set 3 : Update comments. #Patch Set 4 : Better comment. #
Total comments: 2
Messages
Total messages: 12 (5 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||