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

Side by Side Diff: test/js-perf-test/AsyncAwait/baseline-naive-promises.js

Issue 2577393002: [js-perf-test] Add a basic async-await microbenchmark (Closed)
Patch Set: Add a function with multiple awaits 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('BaselineNaivePromises', [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 = function j(p) { return p; };
16 i = function i(p) {
17 var promises = [];
18 for (let i = 0; i < 10; i++) promises.push(j());
19 return Promise.all(promises);
gsathya 2016/12/16 15:23:05 promises is an array of undefineds, not an array o
jgruber 2016/12/19 08:31:01 Good catch, done.
20 };
21 h = function h(p) { return p; };
22 g = function g(p) { return p; };
23 f = function f(p) { return p; };
24 e = function e(p) { return p; };
25 d = function d(p) { return p; };
26 c = function c(p) { return p; };
27 b = function b(p) { return p; };
28 a = function a(p) { return p; };
29
30 %RunMicrotasks();
31 }
32
33 function Basic() {
34 x.then(j)
35 .then(i)
36 .then(h)
37 .then(g)
38 .then(f)
39 .then(e)
40 .then(d)
41 .then(c)
42 .then(b)
43 .then(a);
44 %RunMicrotasks();
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698