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

Function BenchmarkGet

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

Source from the content-addressed store, hash-verified

49}
50
51func BenchmarkGet(b *testing.B) {
52 b.StopTimer()
53 sel := DocB().Find("dd")
54 j := 0
55 b.StartTimer()
56 for i := 0; i < b.N; i++ {
57 sel.Get(j)
58 if j++; j >= sel.Length() {
59 j = 0
60 }
61 }
62}
63
64func BenchmarkIndex(b *testing.B) {
65 var j int

Callers

nothing calls this directly

Calls 4

DocBFunction · 0.85
FindMethod · 0.80
GetMethod · 0.80
LengthMethod · 0.80

Tested by

no test coverage detected