refactor: ensure functions to bench are called properly
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 25 Jun 2023 20:17:02 +0000 (22:17 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 25 Jun 2023 20:17:02 +0000 (22:17 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
benchmarks/versus-external-pools/functions/function-to-bench.mjs
benchmarks/versus-external-pools/workers/workerpool/function-to-bench-worker.mjs

index fbe702292aecc0422cbb109642291de83e39086c..4705273c07e1bd1437d84f75d2a74782747d8e11 100644 (file)
@@ -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'
index 35b2aeb8e9110ffd18b2d6fd7486293259fddb25..d8981c8689916ef820dae21ed12f5f91df0436fe 100644 (file)
@@ -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
 })