workerChoiceStrategyFairSharePoolOption
)
+const fixedThreadPoolFairShareTasksQueue = buildPool(
+ WorkerTypes.THREAD,
+ PoolTypes.FIXED,
+ poolSize,
+ { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption }
+)
+
const dynamicThreadPoolRoundRobin = buildPool(
WorkerTypes.THREAD,
PoolTypes.DYNAMIC,
workerChoiceStrategyFairSharePoolOption
)
+const fixedClusterPoolFairShareTaskQueue = buildPool(
+ WorkerTypes.CLUSTER,
+ PoolTypes.FIXED,
+ poolSize,
+ { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption }
+)
+
const dynamicClusterPoolRoundRobin = buildPool(
WorkerTypes.CLUSTER,
PoolTypes.DYNAMIC,
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(
+ 'Fixed:ClusterPool:FairShare:{ enableTasksQueue: true }',
+ async () => {
+ await runTest(fixedClusterPoolFairShareTaskQueue, {
+ taskExecutions,
+ workerData
+ })
+ }
+ ),
Benchmark.add('Dynamic:ClusterPool:RoundRobin', async () => {
await runTest(dynamicClusterPoolRoundRobin, {
taskExecutions,