aboutsummaryrefslogtreecommitdiff
path: root/x509roots/fallback/fallback_test.go
diff options
context:
space:
mode:
authorMateusz Poliwczak <mpoliwczak34@gmail.com>2025-05-25 16:55:00 +0200
committerGopher Robot <gobot@golang.org>2025-05-31 02:59:11 -0700
commit4f9f0ca9fcfb05873f4a88940e285c7fbf343da5 (patch)
tree98cfeaabbc746b6a532a6bebdfb91d782e985b74 /x509roots/fallback/fallback_test.go
parenteac7cf0d78a4920a916d2eb7e9ced233544fdc08 (diff)
downloadgo-x-crypto-4f9f0ca9fcfb05873f4a88940e285c7fbf343da5.tar.xz
x509roots/fallback: add init time benchmark
goos: linux goarch: amd64 pkg: golang.org/x/crypto/x509roots/fallback cpu: AMD Ryzen 5 4600G with Radeon Graphics │ /tmp/before │ │ sec/op │ InitTime-12 1.726m ± 0% │ /tmp/before │ │ B/op │ InitTime-12 1.151Mi ± 0% │ /tmp/before │ │ allocs/op │ InitTime-12 11.35k ± 0% For golang/go#73691 Change-Id: Ic932bd7835e50dd5c6adbdf684644afa49bddebc Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676216 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Sean Liao <sean@liao.dev> Auto-Submit: Sean Liao <sean@liao.dev> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'x509roots/fallback/fallback_test.go')
-rw-r--r--x509roots/fallback/fallback_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/x509roots/fallback/fallback_test.go b/x509roots/fallback/fallback_test.go
new file mode 100644
index 0000000..e380046
--- /dev/null
+++ b/x509roots/fallback/fallback_test.go
@@ -0,0 +1,11 @@
+package fallback
+
+import "testing"
+
+// BenchmarkInitTime benchmarks the time it takes to parse all certificates
+// in this bundle, it corresponds to the init time of this package.
+func BenchmarkInitTime(b *testing.B) {
+ for range b.N {
+ newFallbackCertPool()
+ }
+}