MCPcopy
hub / github.com/golang-jwt/jwt / benchmarkSigning

Function benchmarkSigning

parser_test.go:879–891  ·  view source on GitHub ↗

Helper method for benchmarking various signing methods

(b *testing.B, method jwt.SigningMethod, key any)

Source from the content-addressed store, hash-verified

877
878// Helper method for benchmarking various signing methods
879func benchmarkSigning(b *testing.B, method jwt.SigningMethod, key any) {
880 b.Helper()
881 t := jwt.New(method)
882 b.ReportAllocs()
883 b.ResetTimer()
884 b.RunParallel(func(pb *testing.PB) {
885 for pb.Next() {
886 if _, err := t.SignedString(key); err != nil {
887 b.Fatal(err)
888 }
889 }
890 })
891}

Callers 7

BenchmarkHS256SigningFunction · 0.85
BenchmarkHS384SigningFunction · 0.85
BenchmarkHS512SigningFunction · 0.85
BenchmarkECDSASigningFunction · 0.85
BenchmarkRS256SigningFunction · 0.85
BenchmarkRS384SigningFunction · 0.85
BenchmarkRS512SigningFunction · 0.85

Calls 1

SignedStringMethod · 0.80

Tested by

no test coverage detected