Skip to content

Commit a271fde

Browse files
committed
Push up the inner loop counts for the doxbee tests
Right now they're quite small and the tests finish in only a few ms. We'd like our tests to run for at least 10ms. After this change the average time in V8, which is the faster browser on this test runs in about 12/14 ms for async/promise respectively.
1 parent 24b1911 commit a271fde

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

JetStreamDriver.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,14 +2109,18 @@ let BENCHMARKS = [
21092109
files: [
21102110
"./simple/doxbee-promise.js",
21112111
],
2112-
tags: ["default", "js", "promise", "Simple"],
2112+
iterations: 80,
2113+
worstCaseCount: 3,
2114+
tags: ["default", "js", "promise", "Simple", "Doxbee"],
21132115
}),
21142116
new AsyncBenchmark({
21152117
name: "doxbee-async",
21162118
files: [
21172119
"./simple/doxbee-async.js",
21182120
],
2119-
tags: ["default", "js", "Simple"],
2121+
iterations: 80,
2122+
worstCaseCount: 3,
2123+
tags: ["default", "js", "async", "Simple", "Doxbee"],
21202124
}),
21212125
// SeaMonster
21222126
new DefaultBenchmark({

simple/doxbee-async.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ const doxbee = require("../lib/doxbee-async");
170170

171171
globalThis.Benchmark = class {
172172
runIteration() {
173-
const promises = new Array(10_000);
173+
const innerIterations = 25_000;
174+
const promises = new Array(innerIterations);
174175

175-
for (var i = 0; i < 10_000; i++)
176+
for (var i = 0; i < innerIterations; i++)
176177
promises[i] = doxbee(i, "foo");
177178

178179
return Promise.all(promises);

simple/doxbee-promise.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ const doxbee = require("../lib/doxbee-promises");
190190

191191
globalThis.Benchmark = class {
192192
runIteration() {
193-
const promises = new Array(10_000);
193+
const innerIterations = 20_000;
194+
const promises = new Array(innerIterations);
194195

195-
for (var i = 0; i < 10_000; i++)
196+
for (var i = 0; i < innerIterations; i++)
196197
promises[i] = doxbee(i, "foo");
197198

198199
return Promise.all(promises);

0 commit comments

Comments
 (0)