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

Unified Diff: test/js-perf-test/Classes/default-constructor.js

Issue 754523004: Add js-perf-test for ES6 class default constructor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add file to dummy Created 6 years 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/Classes/Classes.json ('k') | test/js-perf-test/Classes/run.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/js-perf-test/Classes/default-constructor.js
diff --git a/test/js-perf-test/Classes/default-constructor.js b/test/js-perf-test/Classes/default-constructor.js
new file mode 100644
index 0000000000000000000000000000000000000000..49dcaa6be79ffea129a3c15bdbd02e27180d9789
--- /dev/null
+++ b/test/js-perf-test/Classes/default-constructor.js
@@ -0,0 +1,33 @@
+// Copyright 2014 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.
+'use strict';
+
+var DefaultConstructorBenchmark = new BenchmarkSuite('DefaultConstructor',
+ [100], [
+ new Benchmark('NoSuperClass', false, false, 0, NoSuperClass),
+ new Benchmark('WithSuperClass', false, false, 0, WithSuperClass),
+ new Benchmark('WithSuperClassArguments', false, false, 0,
+ WithSuperClassArguments),
+ ]);
+
+
+class BaseClass {}
+
+
+class DerivedClass extends BaseClass {}
+
+
+function NoSuperClass() {
+ return new BaseClass();
+}
+
+
+function WithSuperClass() {
+ return new DerivedClass();
+}
+
+
+function WithSuperClassArguments() {
+ return new DerivedClass(0, 1, 2, 3, 4);
+}
« no previous file with comments | « test/js-perf-test/Classes/Classes.json ('k') | test/js-perf-test/Classes/run.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698