} = require('./cluster/dynamic')
const {
fixedClusterTest,
+ fixedClusterTasksQueueTest,
fixedClusterTestFairShare,
fixedClusterTestLessUsed,
fixedClusterTestWeightedRoundRobin,
} = require('./thread/dynamic')
const {
fixedThreadTest,
+ fixedThreadTasksQueueTest,
fixedThreadTestFairShare,
fixedThreadTestLessUsed,
fixedThreadTestWeightedRoundRobin,
Benchmark.add('Poolifier:Fixed:ThreadPool', async () => {
await fixedThreadTest()
}),
+ Benchmark.add('Poolifier:Fixed:ThreadPoolTasksQueue', async () => {
+ await fixedThreadTasksQueueTest()
+ }),
Benchmark.add('Poolifier:Fixed:ThreadPool:LessUsed', async () => {
await fixedThreadTestLessUsed()
}),
Benchmark.add('Poolifier:Fixed:ClusterPool', async () => {
await fixedClusterTest()
}),
+ Benchmark.add('Poolifier:Fixed:ClusterPoolTasksQueue', async () => {
+ await fixedClusterTasksQueueTest()
+ }),
Benchmark.add('Poolifier:Fixed:ClusterPool:LessUsed', async () => {
await fixedClusterTestLessUsed()
}),
'./benchmarks/internal/cluster/worker.js'
)
+const fixedPoolTasksQueue = new FixedClusterPool(
+ size,
+ './benchmarks/internal/cluster/worker.js',
+ { enableTasksQueue: true }
+)
+
const fixedPoolLessUsed = new FixedClusterPool(
size,
'./benchmarks/internal/cluster/worker.js',
return runPoolifierTest(fixedPool, { tasks, workerData })
}
+async function fixedClusterTasksQueueTest (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(fixedPoolTasksQueue, { tasks, workerData })
+}
+
async function fixedClusterTestLessUsed (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
fixedClusterTest,
+ fixedClusterTasksQueueTest,
fixedClusterTestLessUsed,
fixedClusterTestLessBusy,
fixedClusterTestWeightedRoundRobin,
'./benchmarks/internal/thread/worker.js'
)
+const fixedPoolTasksQueue = new FixedThreadPool(
+ size,
+ './benchmarks/internal/thread/worker.js',
+ { enableTasksQueue: true }
+)
+
const fixedPoolLessUsed = new FixedThreadPool(
size,
'./benchmarks/internal/thread/worker.js',
return runPoolifierTest(fixedPool, { tasks, workerData })
}
+async function fixedThreadTasksQueueTest (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(fixedPoolTasksQueue, { tasks, workerData })
+}
+
async function fixedThreadTestLessUsed (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
fixedThreadTest,
+ fixedThreadTasksQueueTest,
fixedThreadTestLessUsed,
fixedThreadTestLessBusy,
fixedThreadTestWeightedRoundRobin,