From: Jérôme Benoit Date: Sun, 25 Jun 2023 20:17:02 +0000 (+0200) Subject: refactor: ensure functions to bench are called properly X-Git-Tag: v2.6.4~19 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cd0b5e15352dd0afa6c8f29a28ca8294fa006c38;p=poolifier.git refactor: ensure functions to bench are called properly Signed-off-by: Jérôme Benoit --- 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 })