Index: test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js |
diff --git a/test/js-perf-test/SixSpeed/object_literals/object_literals.js b/test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js |
similarity index 77% |
copy from test/js-perf-test/SixSpeed/object_literals/object_literals.js |
copy to test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js |
index 831e173ec249138710b102273564a322971e0fa8..f4a1d53f5c813901a98531f222a97bef9a4719a3 100644 |
--- a/test/js-perf-test/SixSpeed/object_literals/object_literals.js |
+++ b/test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js |
@@ -6,11 +6,11 @@ |
// Copyright 2014 Kevin Decker <https://github.com/kpdecker/six-speed/> |
-new BenchmarkSuite('ObjectLiterals-ES5', [1000], [ |
+new BenchmarkSuite('ArrayDestructuring-ES5', [1000], [ |
new Benchmark('ES5', false, false, 0, ES5), |
]); |
-new BenchmarkSuite('ObjectLiterals-ES6', [1000], [ |
+new BenchmarkSuite('ArrayDestructuring-ES6', [1000], [ |
new Benchmark('ES6', false, false, 0, ES6), |
]); |
@@ -20,10 +20,9 @@ new BenchmarkSuite('ObjectLiterals-ES6', [1000], [ |
function ES5() { |
"use strict"; |
- var name = 'foo'; |
- var ret = {}; |
- ret[name] = 'bar'; |
- return ret; |
+ var data = [1, 2, 3]; |
+ var c = data[0]; |
+ return c; |
} |
@@ -33,9 +32,7 @@ function ES5() { |
function ES6() { |
"use strict"; |
- var name = 'foo'; |
- var ret = { |
- [name]: 'bar', |
- }; |
- return ret; |
+ var data = [1, 2, 3]; |
+ var [c] = data; |
+ return c; |
} |