@naturalcycles/bench-lib 2.1.1 → 3.0.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.model.d.ts +3 -8
- package/dist/bench.profles.d.ts +3 -4
- package/dist/bench.profles.js +3 -9
- package/dist/bench.util.js +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.js +7 -14
- package/package.json +1 -1
package/dist/bench.model.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
resolve: () => void;
|
|
3
|
-
}
|
|
4
|
-
export type BenchDeferredFunction = (done: BenchDeferred) => any;
|
|
1
|
+
export type BenchFunction = () => void;
|
|
5
2
|
export interface RunBenchOptions {
|
|
6
3
|
/**
|
|
7
4
|
* Functions to benchmark.
|
|
8
|
-
* Record from function name to a `
|
|
9
|
-
* BenchDeferredFunction takes `done` callback as a first argument,
|
|
10
|
-
* `done.resolve()` HAS to be called at the end of your function.
|
|
5
|
+
* Record from function name to a `BenchFunction`.
|
|
11
6
|
*/
|
|
12
|
-
fns: Record<string,
|
|
7
|
+
fns: Record<string, BenchFunction>;
|
|
13
8
|
/**
|
|
14
9
|
* How many times to run.
|
|
15
10
|
* Every second run will be in reverse order.
|
package/dist/bench.profles.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const benchNoopFn:
|
|
3
|
-
export declare const benchRandomFn:
|
|
4
|
-
export declare const benchPDelayFn: BenchDeferredFunction;
|
|
1
|
+
import { BenchFunction } from './bench.model';
|
|
2
|
+
export declare const benchNoopFn: BenchFunction;
|
|
3
|
+
export declare const benchRandomFn: BenchFunction;
|
package/dist/bench.profles.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.benchRandomFn = exports.benchNoopFn = void 0;
|
|
4
4
|
const js_lib_1 = require("@naturalcycles/js-lib");
|
|
5
|
-
const benchNoopFn =
|
|
5
|
+
const benchNoopFn = () => { };
|
|
6
6
|
exports.benchNoopFn = benchNoopFn;
|
|
7
|
-
const benchRandomFn =
|
|
7
|
+
const benchRandomFn = () => {
|
|
8
8
|
const _ = (0, js_lib_1._randomInt)(1, 10);
|
|
9
|
-
done.resolve();
|
|
10
9
|
};
|
|
11
10
|
exports.benchRandomFn = benchRandomFn;
|
|
12
|
-
const benchPDelayFn = async (done) => {
|
|
13
|
-
await (0, js_lib_1.pDelay)();
|
|
14
|
-
done.resolve();
|
|
15
|
-
};
|
|
16
|
-
exports.benchPDelayFn = benchPDelayFn;
|
package/dist/bench.util.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type { RunBenchOptions, BenchDeferredFunction, HertzMap, HttpServerFactory, RunCannonOptions, AutocannonSummary, AutocannonResult, AutocannonOptions, };
|
|
8
|
-
export { runBenchScript, runBench, benchNoopFn, runCannon, runCannonScript, bareNodeServerFactory, bareExpressServerFactory, expressWithMiddlewaresServerFactory, expressFunctionFactory, };
|
|
1
|
+
export * from './bench.model';
|
|
2
|
+
export * from './bench.profles';
|
|
3
|
+
export * from './bench.util';
|
|
4
|
+
export * from './cannon.model';
|
|
5
|
+
export * from './cannon.profiles';
|
|
6
|
+
export * from './cannon.util';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "bareExpressServerFactory", { enumerable: true, get: function () { return cannon_profiles_1.bareExpressServerFactory; } });
|
|
11
|
-
Object.defineProperty(exports, "bareNodeServerFactory", { enumerable: true, get: function () { return cannon_profiles_1.bareNodeServerFactory; } });
|
|
12
|
-
Object.defineProperty(exports, "expressFunctionFactory", { enumerable: true, get: function () { return cannon_profiles_1.expressFunctionFactory; } });
|
|
13
|
-
Object.defineProperty(exports, "expressWithMiddlewaresServerFactory", { enumerable: true, get: function () { return cannon_profiles_1.expressWithMiddlewaresServerFactory; } });
|
|
14
|
-
const cannon_util_1 = require("./cannon.util");
|
|
15
|
-
Object.defineProperty(exports, "runCannon", { enumerable: true, get: function () { return cannon_util_1.runCannon; } });
|
|
16
|
-
Object.defineProperty(exports, "runCannonScript", { enumerable: true, get: function () { return cannon_util_1.runCannonScript; } });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./bench.model"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./bench.profles"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./bench.util"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./cannon.model"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./cannon.profiles"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./cannon.util"), exports);
|