4 } = require('../../../lib/index')
5 const { runPoolifierTest
} = require('../benchmark-utils')
8 const numberOfTasks
= 1
10 const fixedPool
= new FixedThreadPool(
12 './benchmarks/internal/thread/worker.js'
15 const fixedPoolLessRecentlyUsed
= new FixedThreadPool(
17 './benchmarks/internal/thread/worker.js',
18 { workerChoiceStrategy
: WorkerChoiceStrategies
.LESS_RECENTLY_USED
}
21 async
function fixedThreadTest (
22 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
24 return runPoolifierTest(fixedPool
, { tasks
, workerData
})
27 async
function fixedThreadTestLessRecentlyUsed (
28 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
30 return runPoolifierTest(fixedPoolLessRecentlyUsed
, { tasks
, workerData
})
33 module
.exports
= { fixedThreadTest
, fixedThreadTestLessRecentlyUsed
}