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('Set', [1000], [ | 6 var SetBenchmark = new BenchmarkSuite('Set', [1000], [ |
7 new Benchmark('Add', false, false, 0, SetAdd), | 7 new Benchmark('Add', false, false, 0, SetAdd), |
8 new Benchmark('Has', false, false, 0, SetHas, SetSetup, SetTearDown), | 8 new Benchmark('Has', false, false, 0, SetHas, SetSetup, SetTearDown), |
9 new Benchmark('Delete', false, false, 0, SetDelete, SetSetup, SetTearDown), | 9 new Benchmark('Delete', false, false, 0, SetDelete, SetSetup, SetTearDown), |
10 new Benchmark('ForEach', false, false, 0, SetForEach, SetSetup, SetTearDown), | 10 new Benchmark('ForEach', false, false, 0, SetForEach, SetSetup, SetTearDown), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 | 59 |
60 function SetForEach() { | 60 function SetForEach() { |
61 set.forEach(function(v, k) { | 61 set.forEach(function(v, k) { |
62 if (v !== k) { | 62 if (v !== k) { |
63 throw new Error(); | 63 throw new Error(); |
64 } | 64 } |
65 }); | 65 }); |
66 } | 66 } |
OLD | NEW |