X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fbenchmarks-utils.mjs;h=16a656107fc6f00973fe7bdc6541a6bab2794a2b;hb=686b339ec9cdce9d5fcaa92ae3b04cbc0b364f42;hp=8620dd681b10be4b6019dfc3d2be0dcfcf770311;hpb=8f01ffbe12f90c234fe5acb12932b752c56905ef;p=poolifier.git diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index 8620dd68..16a65610 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -54,24 +54,9 @@ const buildPoolifierPool = (workerType, poolType, poolSize, poolOptions) => { } const runPoolifierPool = async (pool, { taskExecutions, workerData }) => { - return await new Promise((resolve, reject) => { - let executions = 0 - for (let i = 1; i <= taskExecutions; i++) { - pool - .execute(workerData) - .then(() => { - ++executions - if (executions === taskExecutions) { - resolve({ ok: 1 }) - } - return undefined - }) - .catch(err => { - console.error(err) - reject(err) - }) - } - }) + for (let i = 1; i <= taskExecutions; i++) { + await pool.execute(workerData) + } } export const runPoolifierBenchmarkTatamiNg = async (