Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js

Issue 2513273002: [test] Add array destructuring micro-benchmarks. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/js-perf-test/SixSpeed.json ('k') | test/js-perf-test/SixSpeed/array_destructuring/run.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « test/js-perf-test/SixSpeed.json ('k') | test/js-perf-test/SixSpeed/array_destructuring/run.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698