| 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 SetBenchmark = new BenchmarkSuite('WeakSet', [1000], [ | 6 var SetBenchmark = new BenchmarkSuite('WeakSet', [1000], [ |
| 7 new Benchmark('Add', false, false, 0, WeakSetAdd), | 7 new Benchmark('Add', false, false, 0, WeakSetAdd), |
| 8 new Benchmark('Has', false, false, 0, WeakSetHas, WeakSetSetup, | 8 new Benchmark('Has', false, false, 0, WeakSetHas, WeakSetSetup, |
| 9 WeakSetTearDown), | 9 WeakSetTearDown), |
| 10 new Benchmark('Delete', false, false, 0, WeakSetDelete, WeakSetSetup, | 10 new Benchmark('Delete', false, false, 0, WeakSetDelete, WeakSetSetup, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 function WeakSetDelete() { | 58 function WeakSetDelete() { |
| 59 // This is run more than once per setup so we will end up deleting items | 59 // This is run more than once per setup so we will end up deleting items |
| 60 // more than once. Therefore, we do not the return value of delete. | 60 // more than once. Therefore, we do not the return value of delete. |
| 61 for (var i = 0; i < N; i++) { | 61 for (var i = 0; i < N; i++) { |
| 62 ws.delete(keys[i]); | 62 ws.delete(keys[i]); |
| 63 } | 63 } |
| 64 } | 64 } |
| OLD | NEW |