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

Function BenchmarkArrayGetStr

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

Source from the content-addressed store, hash-verified

42}
43
44func BenchmarkArrayGetStr(b *testing.B) {
45 b.StopTimer()
46 r := New()
47 v := &Object{runtime: r}
48
49 a := &arrayObject{
50 baseObject: baseObject{
51 val: v,
52 extensible: true,
53 },
54 }
55 v.self = a
56
57 a.init()
58
59 v.setOwn(valueInt(0), asciiString("test"), false)
60 b.StartTimer()
61
62 for i := 0; i < b.N; i++ {
63 a.getStr("0", nil)
64 }
65
66}
67
68func BenchmarkArrayGet(b *testing.B) {
69 b.StopTimer()

Callers

nothing calls this directly

Calls 6

initMethod · 0.95
setOwnMethod · 0.95
getStrMethod · 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…