MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / BenchmarkIndexSelector

Function BenchmarkIndexSelector

bench_array_test.go:78–90  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

76}
77
78func BenchmarkIndexSelector(b *testing.B) {
79 var j int
80
81 b.StopTimer()
82 sel := DocB().Find("#manual-nav dl dd:nth-child(1)")
83 b.StartTimer()
84 for i := 0; i < b.N; i++ {
85 j = sel.IndexSelector("dd")
86 }
87 if j != 4 {
88 b.Fatalf("want 4, got %d", j)
89 }
90}
91
92func BenchmarkIndexOfNode(b *testing.B) {
93 var j int

Callers

nothing calls this directly

Calls 3

DocBFunction · 0.85
FindMethod · 0.80
IndexSelectorMethod · 0.80

Tested by

no test coverage detected