Skip to content

Commit 8828bf6

Browse files
committed
wip
1 parent 8807a09 commit 8828bf6

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

simple/doxbee-async.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ module.exports = {
9898
// a queryish object with all kinds of functions
9999
function Queryish() {}
100100
async function dummy_1() {
101-
return Queryish.count++;
101+
Queryish.count++;
102102
}
103103
async function dummy_2(a) {
104-
//return Queryish.count++;
104+
Queryish.count++;
105105
}
106106

107107
Queryish.count = 0;
@@ -172,31 +172,29 @@ module.exports = {
172172
FileVersion,
173173
Version,
174174
db,
175-
Queryish
175+
Queryish,
176176
};
177177

178178
},{}],3:[function(require,module,exports){
179179
const doxbee = require("../lib/doxbee-async");
180180

181181
globalThis.Benchmark = class {
182-
count = 0;
183-
184-
async runIteration() {
182+
runIteration() {
185183
doxbee.fakes.Queryish.count = 0;
186184
const promises = new Array(10_000);
187185

188186
for (var i = 0; i < 10_000; i++)
189187
promises[i] = doxbee.doxbee(i, "foo");
190188

191-
await Promise.all(promises);
192-
this.count = doxbee.fakes.Queryish.count;
189+
return Promise.all(promises);
193190
}
194191

195192
validate() {
196-
// const EXPECTED_COUNT = 60000;
197-
// if (this.count !== EXPECTED_COUNT) {
198-
// throw new Error(`Expected this.count == ${EXPECTED_COUNT}, but got ${this.count}`);
199-
// }
193+
const EXPECTED_COUNT = 70000;
194+
const count = doxbee.fakes.Queryish.count;
195+
if (count !== EXPECTED_COUNT) {
196+
throw new Error(`Expected this.count == ${EXPECTED_COUNT}, but got ${count}`);
197+
}
200198
}
201199
};
202200

0 commit comments

Comments
 (0)