Chromium Code Reviews| 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 for (let i = 0; i < 9; i++) await j(); | |
|
gsathya
2016/12/16 15:23:05
This isn't semantically equivalent to the promise
jgruber
2016/12/19 08:31:01
Done, removed Promise.all.
| |
| 18 return await j(); | |
| 19 }; | |
| 20 h = async function h() { return await i(); }; | |
| 21 g = async function g() { return await h(); }; | |
| 22 f = async function f() { return await g(); }; | |
| 23 e = async function e() { return await f(); }; | |
| 24 d = async function d() { return await e(); }; | |
| 25 c = async function c() { return await d(); }; | |
| 26 b = async function b() { return await c(); }; | |
| 27 a = async function a() { return await b(); }; | |
|
gsathya
2016/12/16 15:23:05
No need for any await statements here. "return awa
jgruber
2016/12/19 08:31:01
Done.
| |
| 28 | |
|
gsathya
2016/12/16 15:23:05
i would rewrite this as
async function a {
awa
jgruber
2016/12/19 08:31:01
The intention was to have both function nesting (a
| |
| 29 %RunMicrotasks(); | |
| 30 } | |
| 31 | |
| 32 function Basic() { | |
| 33 a(); | |
| 34 %RunMicrotasks(); | |
| 35 } | |
| OLD | NEW |