MCPcopy Create free account
hub / github.com/dop251/goja / BenchmarkArraySetEmpty

Function BenchmarkArraySetEmpty

array_test.go:123–133  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

121}
122
123func BenchmarkArraySetEmpty(b *testing.B) {
124 r := New()
125 _ = r.Get("Array").(*Object).Get("prototype").String() // materialise Array.prototype
126 a := r.NewArray(0, 0)
127 values := a.self.(*arrayObject).values
128 b.ResetTimer()
129 for i := 0; i < b.N; i++ {
130 values[0] = nil
131 a.self.setOwnIdx(0, valueTrue, true)
132 }
133}

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
NewArrayMethod · 0.80
StringMethod · 0.65
GetMethod · 0.65
setOwnIdxMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…