Skip to content

Commit be64bcd

Browse files
authored
chore: Fix broken benchmark (piscinajs#745)
1 parent 22f2c92 commit be64bcd

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

benchmark/piscina-queue-comparison.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { resolve } = require('node:path');
44

55
const QUEUE_SIZE = 100_000;
66

7-
const bench = new Bench({ time: 100 });
7+
const bench = new Bench({ time: 100, warmup: true });
88

99
bench
1010
.add('Piscina with ArrayTaskQueue', async () => {
@@ -35,7 +35,6 @@ bench
3535
});
3636

3737
(async () => {
38-
await bench.warmup();
3938
await bench.run();
4039

4140
console.table(bench.table());

benchmark/queue-comparison.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { ArrayTaskQueue, FixedQueue } = require('..');
33

44
const QUEUE_SIZE = 100_000;
55

6-
const bench = new Bench({ time: 100 });
6+
const bench = new Bench({ time: 100, warmup: true });
77

88
bench
99
.add('ArrayTaskQueue full push + full shift', async () => {
@@ -26,7 +26,6 @@ bench
2626
});
2727

2828
(async () => {
29-
await bench.warmup();
3029
await bench.run();
3130

3231
console.table(bench.table());

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
"test:ci": "npm run lint && npm run build && npm run test:coverage",
2020
"test:coverage": "c8 --reporter=lcov tap --cov",
2121
"prepack": "npm run build",
22-
"benchmark": "npm run bench:queue && npm run benchmark:piscina",
23-
"benchmark:piscina": "npm run benchmark:default &&npm run benchmark:queue:fixed && npm run benchmark:default:comparison",
22+
"benchmark": "npm run benchmark:queue && npm run benchmark:piscina",
23+
"benchmark:piscina": "npm run benchmark:default && npm run benchmark:queue:fixed && npm run benchmark:default:comparison",
2424
"benchmark:default": "node benchmark/simple-benchmark.js",
2525
"benchmark:default:async": "node benchmark/simple-benchmark.js",
2626
"benchmark:default:comparison": "node benchmark/piscina-queue-comparison.js",
27-
"benchmark:queue": "npm run benchmark:queue-comparison",
27+
"benchmark:queue": "npm run benchmark:queue:comparison",
2828
"benchmark:queue:fixed": "node benchmark/simple-benchmark-fixed-queue.js",
2929
"benchmark:queue:comparison": "node benchmark/queue-comparison.js"
3030
},

0 commit comments

Comments
 (0)