OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 var MapBenchmark = new BenchmarkSuite('WeakMap', [1000], [ | 6 var MapBenchmark = new BenchmarkSuite('WeakMap', [1000], [ |
7 new Benchmark('Set', false, false, 0, WeakMapSet), | 7 new Benchmark('Set', false, false, 0, WeakMapSet), |
8 new Benchmark('Has', false, false, 0, WeakMapHas, WeakMapSetup, | 8 new Benchmark('Has', false, false, 0, WeakMapHas, WeakMapSetup, |
9 WeakMapTearDown), | 9 WeakMapTearDown), |
10 new Benchmark('Get', false, false, 0, WeakMapGet, WeakMapSetup, | 10 new Benchmark('Get', false, false, 0, WeakMapGet, WeakMapSetup, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 function WeakMapDelete() { | 74 function WeakMapDelete() { |
75 // This is run more than once per setup so we will end up deleting items | 75 // This is run more than once per setup so we will end up deleting items |
76 // more than once. Therefore, we do not the return value of delete. | 76 // more than once. Therefore, we do not the return value of delete. |
77 for (var i = 0; i < N; i++) { | 77 for (var i = 0; i < N; i++) { |
78 wm.delete(keys[i]); | 78 wm.delete(keys[i]); |
79 } | 79 } |
80 } | 80 } |
OLD | NEW |