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

Side by Side Diff: test/js-perf-test/Modules/run.js

Issue 2833773002: [modules] Add a simple micro-benchmark for import/export accesses. (Closed)
Patch Set: Fix. 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 unified diff | Download patch
« no previous file with comments | « test/js-perf-test/Modules/basic-namespace.js ('k') | test/js-perf-test/Modules/value.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 load('../base.js');
7
8
9 new BenchmarkSuite('BasicExport', [100], [
10 new Benchmark('BasicExport', false, false, 0, BasicExport)
11 ]);
12
13 new BenchmarkSuite('BasicImport', [100], [
14 new Benchmark('BasicImport', false, false, 0, BasicImport)
15 ]);
16
17 new BenchmarkSuite('BasicNamespace', [100], [
18 new Benchmark('BasicNamespace', false, false, 0, BasicNamespace)
19 ]);
20
21
22 const iterations = 3000000;
23
24
25 function BasicExport() {
26 let success = false;
27 import("basic-export.js").then(_ => success = true);
28 %RunMicrotasks();
29 if (!success) throw new Error(666);
30 }
31
32 function BasicImport() {
33 let success = false;
34 import("basic-import.js").then(_ => success = true);
35 %RunMicrotasks();
36 if (!success) throw new Error(666);
37 }
38
39 function BasicNamespace() {
40 let success = false;
41 import("basic-namespace.js").then(_ => success = true);
42 %RunMicrotasks();
43 if (!success) throw new Error(666);
44 }
45
46
47 var success = true;
48
49 function PrintResult(name, result) {
50 print(name + '-Modules(Score): ' + result);
51 }
52
53 function PrintError(name, error) {
54 PrintResult(name, error);
55 success = false;
56 }
57
58
59 BenchmarkSuite.config.doWarmup = undefined;
60 BenchmarkSuite.config.doDeterministic = undefined;
61
62 BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
63 NotifyError: PrintError });
OLDNEW
« no previous file with comments | « test/js-perf-test/Modules/basic-namespace.js ('k') | test/js-perf-test/Modules/value.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698