-const dynamicClusterPoolLeastBusy = buildPool(
- WorkerTypes.cluster,
- PoolTypes.dynamic,
- poolSize,
- workerChoiceStrategyLeastBusyPoolOption
-)
-
-const dynamicClusterPoolWeightedRoundRobin = buildPool(
- WorkerTypes.cluster,
- PoolTypes.dynamic,
- poolSize,
- workerChoiceStrategyWeightedRoundRobinPoolOption
-)
-
-const dynamicClusterPoolFairShare = buildPool(
- WorkerTypes.cluster,
- PoolTypes.dynamic,
- poolSize,
- workerChoiceStrategyFairSharePoolOption
-)
-
-const resultsFile = 'poolifier'
-const resultsFolder = 'benchmarks/internal/results'
-
-Benchmark.suite(
- 'Poolifier',
- Benchmark.add('Fixed:ThreadPool:RoundRobin', async () => {
- await runTest(fixedThreadPoolRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add(
- 'Fixed:ThreadPool:RoundRobin:{ enableTasksQueue: true }',
- async () => {
- await runTest(fixedThreadPoolRoundRobinTasksQueue, {
- taskExecutions,
- workerData
- })
- }
- ),
- Benchmark.add('Fixed:ThreadPool:LeastUsed', async () => {
- await runTest(fixedThreadPoolLeastUsed, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ThreadPool:LeastBusy', async () => {
- await runTest(fixedThreadPoolLeastBusy, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ThreadPool:WeightedRoundRobin', async () => {
- await runTest(fixedThreadPoolWeightedRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ThreadPool:FairShare', async () => {
- await runTest(fixedThreadPoolFairShare, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add(
- 'Fixed:ThreadPool:FairShare:{ enableTasksQueue: true }',
- async () => {
- await runTest(fixedThreadPoolFairShareTasksQueue, {
- taskExecutions,
- workerData
- })
- }
- ),
- Benchmark.add('Dynamic:ThreadPool:RoundRobin', async () => {
- await runTest(dynamicThreadPoolRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ThreadPool:LeastUsed', async () => {
- await runTest(dynamicThreadPoolLeastUsed, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ThreadPool:LeastBusy', async () => {
- await runTest(dynamicThreadPoolLeastBusy, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ThreadPool:WeightedRoundRobin', async () => {
- await runTest(dynamicThreadPoolWeightedRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ThreadPool:FairShare', async () => {
- await runTest(dynamicThreadPoolFairShare, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ClusterPool:RoundRobin', async () => {
- await runTest(fixedClusterPoolRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add(
- 'Fixed:ClusterPool:RoundRobin:{ enableTasksQueue: true }',
- async () => {
- await runTest(fixedClusterPoolRoundRobinTasksQueue, {
- taskExecutions,
- workerData
- })
- }
- ),
- Benchmark.add('Fixed:ClusterPool:LeastUsed', async () => {
- await runTest(fixedClusterPoolLeastUsed, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ClusterPool:LeastBusy', async () => {
- await runTest(fixedClusterPoolLeastBusy, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ClusterPool:WeightedRoundRobin', async () => {
- await runTest(fixedClusterPoolWeightedRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Fixed:ClusterPool:FairShare', async () => {
- await runTest(fixedClusterPoolFairShare, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add(
- 'Fixed:ClusterPool:FairShare:{ enableTasksQueue: true }',
- async () => {
- await runTest(fixedClusterPoolFairShareTaskQueue, {
- taskExecutions,
- workerData
- })
- }
- ),
- Benchmark.add('Dynamic:ClusterPool:RoundRobin', async () => {
- await runTest(dynamicClusterPoolRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ClusterPool:LeastUsed', async () => {
- await runTest(dynamicClusterPoolLeastUsed, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ClusterPool:LeastBusy', async () => {
- await runTest(dynamicClusterPoolLeastBusy, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ClusterPool:WeightedRoundRobin', async () => {
- await runTest(dynamicClusterPoolWeightedRoundRobin, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.add('Dynamic:ClusterPool:FairShare', async () => {
- await runTest(dynamicClusterPoolFairShare, {
- taskExecutions,
- workerData
- })
- }),
- Benchmark.cycle(),
- Benchmark.complete(),
- Benchmark.save({
- file: resultsFile,
- folder: resultsFolder,
- format: 'json',
- details: true
- }),
- Benchmark.save({
- file: resultsFile,
- folder: resultsFolder,
- format: 'chart.html',
- details: true
- }),
- Benchmark.save({
- file: resultsFile,
- folder: resultsFolder,
- format: 'table.html',
- details: true
- })
-)
- .then(() => {
- // eslint-disable-next-line n/no-process-exit
- return process.exit()
- })
- .catch(err => console.error(err))