From de62923af6c62a731fcb60059022d4b70bfabbd1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 13 May 2024 22:00:59 +0200 Subject: [PATCH] perf: cleanup benchmark MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- benchmarks/benchmarks-utils.mjs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) 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 ( -- 2.34.1