crypto/internal/randutil: use math/rand instead of select to speed up MaybeReadByte #26178
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?https://github.com/golang/go/blob/master/src/crypto/internal/randutil/randutil.go#L31
I am not sure this is the best way to make some action with some probability. Or mb there are some reasons to it like this? I wrote a benchmark https://play.golang.org/p/XA0Uv17BPfs .
On my local machine i have such results:
I think random can show better results after using
fastrand
from runtime package.The text was updated successfully, but these errors were encountered: