(b *testing.B)
| 93 | } |
| 94 | |
| 95 | func BenchmarkArrayPut(b *testing.B) { |
| 96 | b.StopTimer() |
| 97 | r := New() |
| 98 | |
| 99 | v := &Object{runtime: r} |
| 100 | |
| 101 | a := &arrayObject{ |
| 102 | baseObject: baseObject{ |
| 103 | val: v, |
| 104 | extensible: true, |
| 105 | }, |
| 106 | } |
| 107 | |
| 108 | v.self = a |
| 109 | |
| 110 | a.init() |
| 111 | |
| 112 | var idx Value = valueInt(0) |
| 113 | var val Value = asciiString("test") |
| 114 | |
| 115 | b.StartTimer() |
| 116 | |
| 117 | for i := 0; i < b.N; i++ { |
| 118 | v.setOwn(idx, val, false) |
| 119 | } |
| 120 | |
| 121 | } |
| 122 | |
| 123 | func BenchmarkArraySetEmpty(b *testing.B) { |
| 124 | r := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…