X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fthread%2Fdynamic.js;h=290820778e44ec7df7d2b2f2101b9dafeef4cb8c;hb=d94bee6fb7e3c48b2490cc4fdd1fe2c205c33f2a;hp=bc9b3d8194e91e14305419eb2265bc4bced929b3;hpb=ff5e76e152be8540cba8118bb4e2b9da314dfff5;p=poolifier.git diff --git a/benchmarks/internal/thread/dynamic.js b/benchmarks/internal/thread/dynamic.js index bc9b3d81..29082077 100644 --- a/benchmarks/internal/thread/dynamic.js +++ b/benchmarks/internal/thread/dynamic.js @@ -2,9 +2,10 @@ const { DynamicThreadPool, WorkerChoiceStrategies } = require('../../../lib/index') -const { runTest } = require('../benchmark-utils') +const { runPoolifierTest } = require('../benchmark-utils') const size = 30 +const numberOfTasks = 1 const dynamicPool = new DynamicThreadPool( size / 2, @@ -16,19 +17,19 @@ const dynamicPoolLessRecentlyUsed = new DynamicThreadPool( size / 2, size * 3, './benchmarks/internal/thread/worker.js', - { workerChoiceStrategy: DynamicThreadPool.LESS_RECENTLY_USED } + { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED } ) async function dynamicThreadTest ( - { tasks, workerData } = { tasks: 1, workerData: { proof: 'ok' } } + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } ) { - return runTest(dynamicPool, { tasks, workerData }) + return runPoolifierTest(dynamicPool, { tasks, workerData }) } async function dynamicThreadTestLessRecentlyUsed ( - { tasks, workerData } = { tasks: 1, workerData: { proof: 'ok' } } + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } ) { - return runTest(dynamicPoolLessRecentlyUsed, { tasks, workerData }) + return runPoolifierTest(dynamicPoolLessRecentlyUsed, { tasks, workerData }) } module.exports = {