MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkCaptcha_VerifyCode_100_50

Function BenchmarkCaptcha_VerifyCode_100_50

internal/waf/captcha_test.go:41–54  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

39}
40
41func BenchmarkCaptcha_VerifyCode_100_50(b *testing.B) {
42 runtime.GOMAXPROCS(4)
43
44 b.RunParallel(func(pb *testing.PB) {
45 for pb.Next() {
46 var id = captcha.NewLen(6)
47 var writer = &bytes.Buffer{}
48 err := captcha.WriteImage(writer, id, 100, 50)
49 if err != nil {
50 b.Fatal(err)
51 }
52 }
53 })
54}
55
56func BenchmarkCaptcha_VerifyCode_200_100(b *testing.B) {
57 runtime.GOMAXPROCS(4)

Callers

nothing calls this directly

Calls 2

NextMethod · 0.80
WriteImageMethod · 0.80

Tested by

no test coverage detected