+export const buildPoolifierPool = (
+ workerType,
+ poolType,
+ poolSize,
+ poolOptions
+) => {
+ switch (poolType) {
+ case PoolTypes.fixed:
+ switch (workerType) {
+ case WorkerTypes.thread:
+ return new FixedThreadPool(
+ poolSize,
+ './benchmarks/internal/thread-worker.mjs',
+ poolOptions
+ )
+ case WorkerTypes.cluster:
+ return new FixedClusterPool(
+ poolSize,
+ './benchmarks/internal/cluster-worker.mjs',
+ poolOptions
+ )
+ }
+ break
+ case PoolTypes.dynamic:
+ switch (workerType) {
+ case WorkerTypes.thread:
+ return new DynamicThreadPool(
+ Math.floor(poolSize / 2),
+ poolSize,
+ './benchmarks/internal/thread-worker.mjs',
+ poolOptions
+ )
+ case WorkerTypes.cluster:
+ return new DynamicClusterPool(
+ Math.floor(poolSize / 2),
+ poolSize,
+ './benchmarks/internal/cluster-worker.mjs',
+ poolOptions
+ )
+ }
+ break
+ }
+}
+
+export const runPoolifierTest = async (
+ pool,
+ { taskExecutions, workerData }
+) => {