Helper method for benchmarking various signing methods
(b *testing.B, method jwt.SigningMethod, key any)
| 877 | |
| 878 | // Helper method for benchmarking various signing methods |
| 879 | func 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 | } |
no test coverage detected