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

Unified Diff: test/js-perf-test/RestParameters/rest.js

Issue 1317113007: [es6] add js-perf-test for rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo Created 5 years, 3 months 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/JSTests.json ('k') | test/js-perf-test/RestParameters/run.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/js-perf-test/RestParameters/rest.js
diff --git a/test/js-perf-test/RestParameters/rest.js b/test/js-perf-test/RestParameters/rest.js
new file mode 100644
index 0000000000000000000000000000000000000000..f449aca36c5fbfa10d81266e135d2e43431e0a19
--- /dev/null
+++ b/test/js-perf-test/RestParameters/rest.js
@@ -0,0 +1,30 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+new BenchmarkSuite('Basic', [1000], [
Michael Achenbach 2015/09/10 12:24:48 s/Basic/BasicRest1 in the suite name to match the
+ new Benchmark('BasicRest1', false, false, 0,
+ BasicRest1, BasicRest1Setup, BasicRest1TearDown)
+]);
+
+// ----------------------------------------------------------------------------
+
+var result;
+
+function basic_rest_fn_1(factor, ...values) {
+ var result = 0;
+ for (var i = 0; i < values.length; ++i) {
+ result += (factor * values[i]);
+ }
+ return result;
+}
+
+function BasicRest1Setup() {}
+
+function BasicRest1() {
+ result = basic_rest_fn_1(10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+}
+
+function BasicRest1TearDown() {
+ return result == 550;
+}
« no previous file with comments | « test/js-perf-test/JSTests.json ('k') | test/js-perf-test/RestParameters/run.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698