X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2FmyBench.js;h=a69de002aab4c6840e03601b34546e3b54c29056;hb=17a9a09416d6c07f560eb0c79bd031d8c0125d4e;hp=216b338e1777f9a74a9a825c4f53dbbd5be849db;hpb=583a27ce13d67cc33ded52f46fe1665c64a8fec7;p=poolifier.git diff --git a/benchmarks/myBench.js b/benchmarks/myBench.js index 216b338e..a69de002 100644 --- a/benchmarks/myBench.js +++ b/benchmarks/myBench.js @@ -7,18 +7,18 @@ const size = 16 // pools const workerThreadsPool = new WorkerThreadsPool({ max: size }) -const workerPool = workerpool.pool('./workerpoolWorker.js', { +const workerPool = workerpool.pool('./external/workerpoolWorker.js', { minWorkers: size / 2, maxWorkers: size * 3, workerType: 'thread' }) -const fixedPool = new FixedThreadPool(size, './threadWorker.js', { +const fixedPool = new FixedThreadPool(size, './thread/worker.js', { maxTasks: 10000 }) const dynamicPool = new DynamicThreadPool( size / 2, size * 3, - './threadWorker.js', + './thread/worker.js', { maxTasks: 10000 } ) @@ -74,7 +74,7 @@ async function workerThreadsPoolTest () { for (let i = 0; i <= tasks; i++) { new Promise((resolve, reject) => { workerThreadsPool.acquire( - './workerThreadsWorker.js', + './external/workerThreadsWorker.js', { workerData: workerData }, (err, worker) => { if (err) { @@ -110,10 +110,6 @@ async function workerpoolTest () { .exec('yourFunction', [workerData]) .then(res => { executions++ - return null - }) - .catch(err => console.error(err)) - .then(res => { if (tasks === executions) { return console.log( `workerpool take ${