From: Jérôme Benoit Date: Mon, 13 May 2024 20:00:59 +0000 (+0200) Subject: perf: cleanup benchmark X-Git-Tag: v4.0.7~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=de62923af6c62a731fcb60059022d4b70bfabbd1;hp=c3d7ff4516f942038eab82743d9373630a61ce48;p=poolifier.git perf: cleanup benchmark Signed-off-by: Jérôme Benoit --- 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 (