From cd0b5e15352dd0afa6c8f29a28ca8294fa006c38 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 25 Jun 2023 22:17:02 +0200 Subject: [PATCH] refactor: ensure functions to bench are called properly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../versus-external-pools/functions/function-to-bench.mjs | 2 +- .../workers/workerpool/function-to-bench-worker.mjs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.mjs b/benchmarks/versus-external-pools/functions/function-to-bench.mjs index fbe70229..4705273c 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.mjs +++ b/benchmarks/versus-external-pools/functions/function-to-bench.mjs @@ -7,7 +7,7 @@ import fs from 'fs' * @param {*} data The worker data. * @returns {*} The result. */ -export default async function functionToBench (data) { +export default function functionToBench (data) { const TaskTypes = { CPU_INTENSIVE: 'CPU_INTENSIVE', IO_INTENSIVE: 'IO_INTENSIVE' diff --git a/benchmarks/versus-external-pools/workers/workerpool/function-to-bench-worker.mjs b/benchmarks/versus-external-pools/workers/workerpool/function-to-bench-worker.mjs index 35b2aeb8..d8981c86 100644 --- a/benchmarks/versus-external-pools/workers/workerpool/function-to-bench-worker.mjs +++ b/benchmarks/versus-external-pools/workers/workerpool/function-to-bench-worker.mjs @@ -1,8 +1,8 @@ import workerpool from 'workerpool' import functionToBench from '../../functions/function-to-bench.mjs' -async function workerPoolWrapperFunctionToBench (testName, taskType, taskSize) { - return await functionToBench({ +function wrapperFunctionToBench (testName, taskType, taskSize) { + return functionToBench({ test: testName, taskType, taskSize @@ -10,5 +10,5 @@ async function workerPoolWrapperFunctionToBench (testName, taskType, taskSize) { } workerpool.worker({ - functionToBench: workerPoolWrapperFunctionToBench + functionToBench: wrapperFunctionToBench }) -- 2.34.1