X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fbenchmarks-utils.js;h=eb3a4f945f40a64a95e010fe375b81c4bb874090;hb=2c039e4373e86714cdf27e77440b12ee8eb2e4db;hp=aac4b78583923252c0c8972273d7c8aced7f9842;hpb=15e4d8f3cafe9f7412913b0e440921e813bdf3cd;p=poolifier.git diff --git a/benchmarks/benchmarks-utils.js b/benchmarks/benchmarks-utils.js index aac4b785..eb3a4f94 100644 --- a/benchmarks/benchmarks-utils.js +++ b/benchmarks/benchmarks-utils.js @@ -1,16 +1,16 @@ const crypto = require('crypto') const fs = require('fs') -const { - PoolTypes, - WorkerFunctions, - WorkerTypes -} = require('./benchmarks-types') const { DynamicClusterPool, DynamicThreadPool, FixedClusterPool, FixedThreadPool } = require('../lib') +const { + PoolTypes, + WorkerFunctions, + WorkerTypes +} = require('./benchmarks-types') async function runTest (pool, { taskExecutions, workerData }) { return new Promise((resolve, reject) => { @@ -114,15 +114,15 @@ function executeWorkerFunction (data) { function buildPool (workerType, poolType, poolSize, poolOptions) { switch (poolType) { - case PoolTypes.FIXED: + case PoolTypes.fixed: switch (workerType) { - case WorkerTypes.THREAD: + case WorkerTypes.thread: return new FixedThreadPool( poolSize, './benchmarks/internal/thread-worker.js', poolOptions ) - case WorkerTypes.CLUSTER: + case WorkerTypes.cluster: return new FixedClusterPool( poolSize, './benchmarks/internal/cluster-worker.js', @@ -130,16 +130,16 @@ function buildPool (workerType, poolType, poolSize, poolOptions) { ) } break - case PoolTypes.DYNAMIC: + case PoolTypes.dynamic: switch (workerType) { - case WorkerTypes.THREAD: + case WorkerTypes.thread: return new DynamicThreadPool( poolSize / 2, poolSize * 3, './benchmarks/internal/thread-worker.js', poolOptions ) - case WorkerTypes.CLUSTER: + case WorkerTypes.cluster: return new DynamicClusterPool( poolSize / 2, poolSize * 3,