4 } = require('../../../lib/index')
5 const { runPoolifierTest
} = require('../benchmark-utils')
8 const numberOfTasks
= 1
10 const dynamicPool
= new DynamicThreadPool(
13 './benchmarks/internal/thread/worker.js'
16 const dynamicPoolLessRecentlyUsed
= new DynamicThreadPool(
19 './benchmarks/internal/thread/worker.js',
20 { workerChoiceStrategy
: WorkerChoiceStrategies
.LESS_RECENTLY_USED
}
23 async
function dynamicThreadTest (
24 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
26 return runPoolifierTest(dynamicPool
, { tasks
, workerData
})
29 async
function dynamicThreadTestLessRecentlyUsed (
30 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
32 return runPoolifierTest(dynamicPoolLessRecentlyUsed
, { tasks
, workerData
})
37 dynamicThreadTestLessRecentlyUsed