import { TaskFunctions } from '../benchmarks-types.cjs'
import {
buildPoolifierBenchmarkMitata,
- runPoolifierBenchmarkBenchmarkJs
+ runPoolifierBenchmarkBenchmarkJsSuite
} from '../benchmarks-utils.mjs'
const poolSize = availableParallelism()
taskSize: 50000
}
-const options = {
- type: {
- type: 'string',
- short: 't'
- }
-}
-const { values } = parseArgs({
- args: process.argv,
- options,
- strict: true,
- allowPositionals: true
-})
-
let fixedThreadPool
let dynamicThreadPool
let fixedClusterPool
let dynamicClusterPool
-switch (values.type) {
+switch (
+ parseArgs({
+ args: process.argv,
+ options: {
+ type: {
+ type: 'string',
+ short: 't'
+ }
+ },
+ strict: true,
+ allowPositionals: true
+ }).values.type
+) {
case 'mitata':
fixedThreadPool = buildPoolifierBenchmarkMitata(
'FixedThreadPool',
break
case 'benchmark.js':
default:
- await runPoolifierBenchmarkBenchmarkJs(
+ await runPoolifierBenchmarkBenchmarkJsSuite(
'FixedThreadPool',
WorkerTypes.thread,
PoolTypes.fixed,
workerData
}
)
- await runPoolifierBenchmarkBenchmarkJs(
+ await runPoolifierBenchmarkBenchmarkJsSuite(
'DynamicThreadPool',
WorkerTypes.thread,
PoolTypes.dynamic,
workerData
}
)
- await runPoolifierBenchmarkBenchmarkJs(
+ await runPoolifierBenchmarkBenchmarkJsSuite(
'FixedClusterPool',
WorkerTypes.cluster,
PoolTypes.fixed,
workerData
}
)
- await runPoolifierBenchmarkBenchmarkJs(
+ await runPoolifierBenchmarkBenchmarkJsSuite(
'DynamicClusterPool',
WorkerTypes.cluster,
PoolTypes.dynamic,