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

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

Issue 2823343004: [js-perf-test] Add microbenchmarks for materialized rest parameters. (Closed)
Patch Set: Created 3 years, 8 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') | no next file » | 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
index cf52f5f45f50859c37ca8452fef6e45829d26aed..1e5f67a362af3da94e314aa3a887166aeed561e7 100644
--- a/test/js-perf-test/RestParameters/rest.js
+++ b/test/js-perf-test/RestParameters/rest.js
@@ -7,6 +7,18 @@ new BenchmarkSuite('Basic1', [1000], [
BasicRest1, BasicRest1Setup, BasicRest1TearDown)
]);
+new BenchmarkSuite('ReturnArgsBabel', [10000], [
+ new Benchmark('ReturnArgsBabel', false, false, 0,
+ ReturnArgsBabel, ReturnArgsBabelSetup,
+ ReturnArgsBabelTearDown)
+]);
+
+new BenchmarkSuite('ReturnArgsNative', [10000], [
+ new Benchmark('ReturnArgsNative', false, false, 0,
+ ReturnArgsNative, ReturnArgsNativeSetup,
+ ReturnArgsNativeTearDown)
+]);
+
// ----------------------------------------------------------------------------
var result;
@@ -28,3 +40,57 @@ function BasicRest1() {
function BasicRest1TearDown() {
return result == 550;
}
+
+// ----------------------------------------------------------------------------
+
+var length = 50;
+var numbers = Array.apply(null, {length}).map(Number.call, Number);
+var strings = numbers.map(String.call, String);
+
+function ReturnArgsBabelFunction(unused) {
+ "use strict";
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0),
+ _key = 1;
+ _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+ return args;
+}
+
+function ReturnArgsBabelSetup() {
+ // Warm up with FAST_HOLEY_ELEMENTS
+ result = ReturnArgsBabelFunction(...strings);
+ // Warm up with FAST_HOLEY_SMI_ELEMENTS
+ result = ReturnArgsBabelFunction(...numbers);
+}
+
+function ReturnArgsBabel() {
+ result = ReturnArgsBabelFunction(...strings);
+ result = ReturnArgsBabelFunction(...numbers);
+}
+
+function ReturnArgsBabelTearDown() {
+ return result.indexOf(0) === 0;
+}
+
+// ----------------------------------------------------------------------------
+
+function ReturnArgsNativeFunction(unused, ...args) {
+ return args;
+}
+
+function ReturnArgsNativeSetup() {
+ // Warm up with FAST_HOLEY_ELEMENTS
+ result = ReturnArgsNativeFunction(...strings);
+ // Warm up with FAST_HOLEY_SMI_ELEMENTS
+ result = ReturnArgsNativeFunction(...numbers);
+}
+
+function ReturnArgsNative() {
+ result = ReturnArgsNativeFunction(...strings);
+ result = ReturnArgsNativeFunction(...numbers);
+}
+
+function ReturnArgsNativeTearDown() {
+ return result.indexOf(0) === 0;
+}
« no previous file with comments | « test/js-perf-test/JSTests.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698