}
}
-export const convertTatamiNgToBmf = report => {
- return report.benchmarks
- .map(({ name, stats }) => {
- // https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae
- const throughputSd = (1e9 * stats?.sd) / stats?.avg ** 2
- return {
- [name]: {
- latency: {
- lower_value: stats?.avg - stats?.sd,
- upper_value: stats?.avg + stats?.sd,
- value: stats?.avg,
- },
- throughput: {
- lower_value: stats?.iters - throughputSd,
- upper_value: stats?.iters + throughputSd,
- value: stats?.iters,
- },
- },
- }
- })
- .reduce((obj, item) => Object.assign(obj, item), {})
-}
-
export { executeTaskFunction }
import { env } from 'node:process'
// eslint-disable-next-line n/no-unsupported-features/node-builtins
import { parseArgs } from 'node:util'
+import { bmf } from 'tatami-ng'
import {
availableParallelism,
WorkerTypes,
} from '../../lib/index.mjs'
import { TaskFunctions } from '../benchmarks-types.cjs'
-import {
- convertTatamiNgToBmf,
- runPoolifierBenchmarkTatamiNg,
-} from '../benchmarks-utils.mjs'
+import { runPoolifierBenchmarkTatamiNg } from '../benchmarks-utils.mjs'
const poolSize = availableParallelism()
const taskExecutions = 1
) {
case 'tatami-ng':
default:
- benchmarkReport = convertTatamiNgToBmf(
+ benchmarkReport = bmf(
await runPoolifierBenchmarkTatamiNg(
'FixedThreadPool',
WorkerTypes.thread,
)
benchmarkReport = {
...benchmarkReport,
- ...convertTatamiNgToBmf(
+ ...bmf(
await runPoolifierBenchmarkTatamiNg(
'DynamicThreadPool',
WorkerTypes.thread,
}
benchmarkReport = {
...benchmarkReport,
- ...convertTatamiNgToBmf(
+ ...bmf(
await runPoolifierBenchmarkTatamiNg(
'FixedClusterPool',
WorkerTypes.cluster,
}
benchmarkReport = {
...benchmarkReport,
- ...convertTatamiNgToBmf(
+ ...bmf(
await runPoolifierBenchmarkTatamiNg(
'DynamicClusterPool',
WorkerTypes.cluster,
"rollup-plugin-delete": "^2.1.0",
"rollup-plugin-dts": "^6.1.1",
"sinon": "^19.0.2",
- "tatami-ng": "^0.7.3",
+ "tatami-ng": "^0.7.4",
"typedoc": "^0.26.7",
"typescript": "~5.6.2"
}
specifier: ^19.0.2
version: 19.0.2
tatami-ng:
- specifier: ^0.7.3
- version: 0.7.3(typescript@5.6.2)
+ specifier: ^0.7.4
+ version: 0.7.4(typescript@5.6.2)
typedoc:
specifier: ^0.26.7
version: 0.26.7(typescript@5.6.2)
resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}
engines: {node: '>=6'}
- tatami-ng@0.7.3:
- resolution: {integrity: sha512-Q3ADpJH/QpL83Rg/gW8nc/BUZS5nkt4CR5CYPhiutsm8OiRtZlNA3+hk+kiUMsAbXNZ97vUPpQQrRqo0bLHCpQ==}
+ tatami-ng@0.7.4:
+ resolution: {integrity: sha512-i1ZcyYi0rnHIPf8Pp45HxZBm3UQe5lzThoM4RPaG4tVnmkXCZTVovEwoRFUp7rxfZwQpOGCH+lX63cnmAw70aA==}
hasBin: true
peerDependencies:
typescript: ^5.4.3
tapable@2.2.1: {}
- tatami-ng@0.7.3(typescript@5.6.2):
+ tatami-ng@0.7.4(typescript@5.6.2):
dependencies:
peowly: 1.3.2
typescript: 5.6.2