OLD | NEW |
(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 }); |
OLD | NEW |