4 } = require('../../../lib/index')
5 const { runPoolifierTest
} = require('../benchmark-utils')
9 const dynamicPool
= new DynamicThreadPool(
12 './benchmarks/internal/thread/worker.js'
15 const dynamicPoolLessRecentlyUsed
= new DynamicThreadPool(
18 './benchmarks/internal/thread/worker.js',
19 { workerChoiceStrategy
: WorkerChoiceStrategies
.LESS_RECENTLY_USED
}
22 async
function dynamicThreadTest (
23 { tasks
, workerData
} = { tasks
: 1, workerData
: { proof
: 'ok' } }
25 return runPoolifierTest(dynamicPool
, { tasks
, workerData
})
28 async
function dynamicThreadTestLessRecentlyUsed (
29 { tasks
, workerData
} = { tasks
: 1, workerData
: { proof
: 'ok' } }
31 return runPoolifierTest(dynamicPoolLessRecentlyUsed
, { tasks
, workerData
})
36 dynamicThreadTestLessRecentlyUsed