aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/sql.go
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2024-03-07 00:18:02 +0100
committerGopher Robot <gobot@golang.org>2024-03-19 20:02:21 +0000
commit99522de1c38e4915e061cd2dac7d34ee888c8318 (patch)
treeffa5113baa35d77f74e9f98d56a6f352b1cc0af8 /src/database/sql/sql.go
parent8f7df2256e271c8d8d170791c6cd90ba9cc69f5e (diff)
downloadgo-99522de1c38e4915e061cd2dac7d34ee888c8318.tar.xz
crypto/rand: use arc4random(3) on macOS and iOS
It's been good since Sierra: it never fails, it's faster, it's available on iOS (see #47812), and it still handles forks and reseeding. On a M2 with macOS 14.3.1: │ sec/op │ sec/op vs base │ Read/32-8 413.7n ± 3% 249.7n ± 3% -39.65% (p=0.000 n=10) Read/4K-8 7.097µ ± 6% 1.261µ ± 2% -82.24% (p=0.000 n=10) │ B/s │ B/s vs base │ Read/32-8 73.76Mi ± 3% 122.25Mi ± 3% +65.73% (p=0.000 n=10) Read/4K-8 550.5Mi ± 6% 3099.0Mi ± 2% +462.99% (p=0.000 n=10) arc4random(3) would be a good replacement for getentropy(2) on FreeBSD and NetBSD as well, but we don't get as easy access to libc there. Cq-Include-Trybots: luci.golang.try:gotip-darwin-amd64-longtest,gotip-darwin-amd64-nocgo,gotip-darwin-arm64_13,gotip-darwin-amd64_11,gotip-darwin-amd64_12,gotip-darwin-amd64_13,gotip-darwin-amd64_14 Change-Id: Ia76824853be92b4d1786e23592a1d2ef24d8907d Reviewed-on: https://go-review.googlesource.com/c/go/+/569655 Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Diffstat (limited to 'src/database/sql/sql.go')
0 files changed, 0 insertions, 0 deletions