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

Side by Side Diff: test/js-perf-test/AsyncAwait/native.js

Issue 2577393002: [js-perf-test] Add a basic async-await microbenchmark (Closed)
Patch Set: Re-babel Created 4 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698