1 import { exit } from 'node:process'
2 import { parseArgs } from 'node:util'
4 import { run } from 'mitata'
10 } from '../../lib/index.mjs'
11 import { TaskFunctions } from '../benchmarks-types.cjs'
13 buildPoolifierBenchmarkMitata,
14 runPoolifierBenchmarkBenchmarkJs
15 } from '../benchmarks-utils.mjs'
17 const poolSize = availableParallelism()
18 const taskExecutions = 1
20 function: TaskFunctions.factorial,
30 const { values } = parseArgs({
34 allowPositionals: true
40 let dynamicClusterPool
41 switch (values.type) {
43 fixedThreadPool = buildPoolifierBenchmarkMitata(
53 dynamicThreadPool = buildPoolifierBenchmarkMitata(
63 fixedClusterPool = buildPoolifierBenchmarkMitata(
73 dynamicClusterPool = buildPoolifierBenchmarkMitata(
84 await fixedThreadPool.destroy()
85 await dynamicThreadPool.destroy()
86 await fixedClusterPool.destroy()
87 await dynamicClusterPool.destroy()
91 await runPoolifierBenchmarkBenchmarkJs(
101 await runPoolifierBenchmarkBenchmarkJs(
111 await runPoolifierBenchmarkBenchmarkJs(
121 await runPoolifierBenchmarkBenchmarkJs(
122 'DynamicClusterPool',