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

Function BenchmarkArrayGet

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

Source from the content-addressed store, hash-verified

66}
67
68func BenchmarkArrayGet(b *testing.B) {
69 b.StopTimer()
70 r := New()
71 v := &Object{runtime: r}
72
73 a := &arrayObject{
74 baseObject: baseObject{
75 val: v,
76 extensible: true,
77 },
78 }
79 v.self = a
80
81 a.init()
82
83 var idx Value = valueInt(0)
84
85 v.setOwn(idx, asciiString("test"), false)
86
87 b.StartTimer()
88
89 for i := 0; i < b.N; i++ {
90 v.get(idx, nil)
91 }
92
93}
94
95func BenchmarkArrayPut(b *testing.B) {
96 b.StopTimer()

Callers

nothing calls this directly

Calls 6

initMethod · 0.95
setOwnMethod · 0.95
getMethod · 0.95
NewFunction · 0.85
valueIntTypeAlias · 0.85
asciiStringTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…