@naturalcycles/bench-lib 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bench.util.js +1 -1
- package/dist/cannon.util.js +4 -2
- package/package.json +7 -7
package/dist/bench.util.js
CHANGED
|
@@ -43,7 +43,7 @@ export async function runBench(opt) {
|
|
|
43
43
|
// })
|
|
44
44
|
fs2.ensureDir(reportDirPath);
|
|
45
45
|
const summaryJsonPath = `${reportDirPath}/${name}.json`;
|
|
46
|
-
fs2.
|
|
46
|
+
fs2.writePrettyJson(summaryJsonPath, avg);
|
|
47
47
|
console.log(`saved ${dimGrey(summaryJsonPath)}`);
|
|
48
48
|
}
|
|
49
49
|
// Vega plots are currently disabled
|
package/dist/cannon.util.js
CHANGED
|
@@ -63,11 +63,11 @@ export async function runCannon(profiles, optInput = {}) {
|
|
|
63
63
|
console.table(summaries);
|
|
64
64
|
if (opt.writeSummary) {
|
|
65
65
|
const summaryJsonPath = `${reportDirPath}/${opt.name}.summary.json`;
|
|
66
|
-
fs2.
|
|
66
|
+
fs2.writePrettyJson(summaryJsonPath, summaries);
|
|
67
67
|
console.log(`saved ${dimGrey(summaryJsonPath)}`);
|
|
68
68
|
}
|
|
69
69
|
if (opt.writeRawSummary) {
|
|
70
|
-
fs2.
|
|
70
|
+
fs2.writePrettyJson(`${reportDirPath}/${opt.name}.rawSummary.json`, resultByProfile);
|
|
71
71
|
}
|
|
72
72
|
// if (opt.writePlots) {
|
|
73
73
|
// await writePlotFiles(opt, summaries)
|
|
@@ -76,6 +76,8 @@ export async function runCannon(profiles, optInput = {}) {
|
|
|
76
76
|
}
|
|
77
77
|
async function runCannonProfile(profileName, serverFactory, opt) {
|
|
78
78
|
const { runs, connections, pipelining, duration, cooldown, host, renderProgressBar, renderResultsTable, renderLatencyTable, silent, } = opt;
|
|
79
|
+
// `as any` suppresses TS7016 (autocannon has no type declarations)
|
|
80
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-assertion
|
|
79
81
|
const { default: autocannon } = await import('autocannon');
|
|
80
82
|
const server = await serverFactory();
|
|
81
83
|
await new Promise(resolve => server.listen(0, resolve));
|
package/package.json
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@naturalcycles/js-lib": "^15",
|
|
6
6
|
"@naturalcycles/nodejs-lib": "^15",
|
|
7
|
-
"autocannon": "^
|
|
7
|
+
"autocannon": "^9",
|
|
8
8
|
"benchmark": "^2",
|
|
9
9
|
"hdr-histogram-js": "^3",
|
|
10
10
|
"tslib": "^2"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
+
"@naturalcycles/dev-lib": "0.0.0",
|
|
13
14
|
"@types/benchmark": "^2",
|
|
14
15
|
"@types/cors": "^2",
|
|
15
16
|
"@types/express": "^5",
|
|
16
|
-
"@types/node": "^
|
|
17
|
-
"
|
|
17
|
+
"@types/node": "^26",
|
|
18
|
+
"typescript": "^7",
|
|
18
19
|
"express": "^5",
|
|
19
20
|
"fastify": "^5",
|
|
20
21
|
"helmet": "^8",
|
|
21
|
-
"nanoid": "^
|
|
22
|
-
"@naturalcycles/dev-lib": "20.42.0"
|
|
22
|
+
"nanoid": "^6"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
".": "./dist/index.js"
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"directory": "packages/bench-lib"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
41
|
+
"node": ">=26.12.1"
|
|
42
42
|
},
|
|
43
|
-
"version": "4.
|
|
43
|
+
"version": "4.9.0",
|
|
44
44
|
"description": "Benchmarking library, based on Benchmark.js and Autocannon",
|
|
45
45
|
"author": "Natural Cycles Team",
|
|
46
46
|
"license": "MIT",
|