-const pools = []
-for (const poolType of Object.values(PoolTypes)) {
- for (const workerType of Object.values(WorkerTypes)) {
- if (workerType === WorkerTypes.cluster) {
- continue
+const taskExecutions = 1
+const workerData = {
+ function: TaskFunctions.factorial,
+ taskSize: 1000,
+}
+const benchmarkReportFile = 'benchmark-report.json'
+let benchmarkReport
+
+switch (
+ parseArgs({
+ args: process.argv,
+ options: {
+ type: {
+ type: 'string',
+ short: 't',
+ },
+ },
+ strict: true,
+ allowPositionals: true,
+ }).values.type
+) {
+ case 'tatami-ng':
+ default:
+ benchmarkReport = convertTatamiNgToBmf(
+ await runPoolifierBenchmarkTatamiNg(
+ 'FixedThreadPool',
+ WorkerTypes.thread,
+ PoolTypes.fixed,
+ poolSize,
+ {
+ taskExecutions,
+ workerData,
+ }
+ )
+ )
+ benchmarkReport = {
+ ...benchmarkReport,
+ ...convertTatamiNgToBmf(
+ await runPoolifierBenchmarkTatamiNg(
+ 'DynamicThreadPool',
+ WorkerTypes.thread,
+ PoolTypes.dynamic,
+ poolSize,
+ {
+ taskExecutions,
+ workerData,
+ }
+ )
+ ),