FixedThreadPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
-const { runPoolifierTest } = require('../benchmark-utils')
+const { runPoolifierTest } = require('../../benchmarks-utils')
const size = 30
const numberOfTasks = 1
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED }
)
+const fixedPoolWeightedRoundRobin = new FixedThreadPool(
+ size,
+ './benchmarks/internal/thread/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
+)
+
const fixedPoolFairShare = new FixedThreadPool(
size,
'./benchmarks/internal/thread/worker.js',
return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData })
}
+async function fixedThreadTestWeightedRoundRobin (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(fixedPoolWeightedRoundRobin, { tasks, workerData })
+}
+
async function fixedThreadTestFairShare (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
fixedThreadTest,
- fixedThreadTestFairShare,
- fixedThreadTestLessRecentlyUsed
+ fixedThreadTestLessRecentlyUsed,
+ fixedThreadTestWeightedRoundRobin,
+ fixedThreadTestFairShare
}