import { writeFileSync } from 'node:fs'
-import { env, exit } from 'node:process'
+import { env } from 'node:process'
// eslint-disable-next-line n/no-unsupported-features/node-builtins
import { parseArgs } from 'node:util'
import {
availableParallelism,
PoolTypes,
- WorkerTypes
+ WorkerTypes,
} from '../../lib/index.mjs'
import { TaskFunctions } from '../benchmarks-types.cjs'
import {
convertTatamiNgToBmf,
- runPoolifierBenchmarkTatamiNg
+ runPoolifierBenchmarkTatamiNg,
} from '../benchmarks-utils.mjs'
const poolSize = availableParallelism()
const taskExecutions = 1
const workerData = {
function: TaskFunctions.factorial,
- taskSize: 1000
+ taskSize: 1000,
}
const benchmarkReportFile = 'benchmark-report.json'
let benchmarkReport
options: {
type: {
type: 'string',
- short: 't'
- }
+ short: 't',
+ },
},
strict: true,
- allowPositionals: true
+ allowPositionals: true,
}).values.type
) {
case 'tatami-ng':
poolSize,
{
taskExecutions,
- workerData
+ workerData,
}
)
)
poolSize,
{
taskExecutions,
- workerData
+ workerData,
}
)
- )
+ ),
}
benchmarkReport = {
...benchmarkReport,
poolSize,
{
taskExecutions,
- workerData
+ workerData,
}
)
- )
+ ),
}
benchmarkReport = {
...benchmarkReport,
poolSize,
{
taskExecutions,
- workerData
+ workerData,
}
)
- )
+ ),
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
env.CI != null &&
writeFileSync(benchmarkReportFile, JSON.stringify(benchmarkReport))
break
}
-
-exit()