@naturalcycles/bench-lib 4.0.3 → 4.2.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/asciiChart.util.js +3 -3
- package/dist/bench.util.js +3 -2
- package/dist/cannon.util.js +4 -3
- package/package.json +1 -1
package/dist/asciiChart.util.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _arrayFilled } from '@naturalcycles/js-lib';
|
|
2
2
|
import { asciiColor, asciiPlot } from './vendor/asciichart.js';
|
|
3
3
|
const colors = [
|
|
4
4
|
asciiColor.blue,
|
|
@@ -14,9 +14,9 @@ export function plotAsciiChart(results) {
|
|
|
14
14
|
const resultsLen = Object.keys(results).length;
|
|
15
15
|
Object.values(results).forEach((result, i) => {
|
|
16
16
|
series.push([
|
|
17
|
-
...
|
|
17
|
+
..._arrayFilled(5 + 5 * i, 0),
|
|
18
18
|
result,
|
|
19
|
-
...
|
|
19
|
+
..._arrayFilled(3 + 5 * (resultsLen - i), 0),
|
|
20
20
|
]);
|
|
21
21
|
});
|
|
22
22
|
let s = asciiPlot(series, {
|
package/dist/bench.util.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _range, pDefer } from '@naturalcycles/js-lib';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { runScript } from '@naturalcycles/nodejs-lib';
|
|
3
|
+
import { dimGrey, yellow } from '@naturalcycles/nodejs-lib/colors';
|
|
4
|
+
import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
|
|
4
5
|
import Benchmark from 'benchmark';
|
|
5
6
|
import { plotAsciiChart } from './asciiChart.util.js';
|
|
6
7
|
/**
|
package/dist/cannon.util.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _omit, _range, pDefer, pDelay } from '@naturalcycles/js-lib';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { runScript } from '@naturalcycles/nodejs-lib';
|
|
3
|
+
import { boldRed, dimGrey, yellow } from '@naturalcycles/nodejs-lib/colors';
|
|
4
|
+
import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
|
|
4
5
|
import hdr from 'hdr-histogram-js';
|
|
5
6
|
/**
|
|
6
7
|
* Wraps `runBench` in `runScript` for convenience, so it can be run in top-level without `await`.
|
|
@@ -53,7 +54,7 @@ export async function runCannon(profiles, optInput = {}) {
|
|
|
53
54
|
resultByProfile[profileName] = await runCannonProfile(profileName, profiles[profileName], opt);
|
|
54
55
|
const summary = toSummary(profileName, resultByProfile[profileName]);
|
|
55
56
|
if (!opt.includeLatencyPercentiles) {
|
|
56
|
-
_omit(summary, ['latency90', 'latency99'], true);
|
|
57
|
+
_omit(summary, ['latency90', 'latency99'], { mutate: true });
|
|
57
58
|
}
|
|
58
59
|
summaries.push(summary);
|
|
59
60
|
}
|