OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 new BenchmarkSuite('Native', [1000], [ |
| 7 new Benchmark('Basic', false, false, 0, Basic, Setup), |
| 8 ]); |
| 9 |
| 10 var a,b,c,d,e,f,g,h,i,j,x; |
| 11 |
| 12 function Setup() { |
| 13 x = Promise.resolve(); |
| 14 |
| 15 j = async function j() { return x; }; |
| 16 i = async function i() { |
| 17 await j(); |
| 18 await j(); |
| 19 await j(); |
| 20 await j(); |
| 21 await j(); |
| 22 await j(); |
| 23 await j(); |
| 24 await j(); |
| 25 await j(); |
| 26 return j(); |
| 27 }; |
| 28 h = async function h() { return i(); }; |
| 29 g = async function g() { return h(); }; |
| 30 f = async function f() { return g(); }; |
| 31 e = async function e() { return f(); }; |
| 32 d = async function d() { return e(); }; |
| 33 c = async function c() { return d(); }; |
| 34 b = async function b() { return c(); }; |
| 35 a = async function a() { return b(); }; |
| 36 |
| 37 %RunMicrotasks(); |
| 38 } |
| 39 |
| 40 function Basic() { |
| 41 a(); |
| 42 %RunMicrotasks(); |
| 43 } |
OLD | NEW |