4 } = require('../../../lib/index')
5 const { runPoolifierTest
} = require('../benchmark-utils')
8 const numberOfTasks
= 1
10 const fixedPool
= new FixedClusterPool(
12 './benchmarks/internal/cluster/worker.js'
15 const fixedPoolLessRecentlyUsed
= new FixedClusterPool(
17 './benchmarks/internal/cluster/worker.js',
18 { workerChoiceStrategy
: WorkerChoiceStrategies
.LESS_RECENTLY_USED
}
21 const fixedPoolFairShare
= new FixedClusterPool(
23 './benchmarks/internal/cluster/worker.js',
24 { workerChoiceStrategy
: WorkerChoiceStrategies
.FAIR_SHARE
}
27 async
function fixedClusterTest (
28 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
30 return runPoolifierTest(fixedPool
, { tasks
, workerData
})
33 async
function fixedClusterTestLessRecentlyUsed (
34 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
36 return runPoolifierTest(fixedPoolLessRecentlyUsed
, { tasks
, workerData
})
39 async
function fixedClusterTestFairShare (
40 { tasks
, workerData
} = { tasks
: numberOfTasks
, workerData
: { proof
: 'ok' } }
42 return runPoolifierTest(fixedPoolFairShare
, { tasks
, workerData
})
47 fixedClusterTestFairShare
,
48 fixedClusterTestLessRecentlyUsed