MCPcopy
hub / github.com/PuerkitoBio/goquery / BenchmarkFind

Function BenchmarkFind

bench_traversal_test.go:9–23  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

7)
8
9func BenchmarkFind(b *testing.B) {
10 var n int
11
12 for i := 0; i < b.N; i++ {
13 if n == 0 {
14 n = DocB().Find("dd").Length()
15
16 } else {
17 DocB().Find("dd")
18 }
19 }
20 if n != 41 {
21 b.Fatalf("want 41, got %d", n)
22 }
23}
24
25func BenchmarkFindWithinSelection(b *testing.B) {
26 var n int

Callers

nothing calls this directly

Calls 3

DocBFunction · 0.85
LengthMethod · 0.80
FindMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…