All notable changes to this project will be documented in this file.
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
dynamicClusterTest,
dynamicClusterTestFairShare,
dynamicClusterTestLessUsed,
- dynamicClusterTestWeightedRoundRobin
+ dynamicClusterTestWeightedRoundRobin,
+ dynamicClusterTestLessBusy
} = require('./cluster/dynamic')
const {
fixedClusterTest,
fixedClusterTestFairShare,
fixedClusterTestLessUsed,
- fixedClusterTestWeightedRoundRobin
+ fixedClusterTestWeightedRoundRobin,
+ fixedClusterTestLessBusy
} = require('./cluster/fixed')
const {
dynamicThreadTest,
dynamicThreadTestFairShare,
dynamicThreadTestLessUsed,
- dynamicThreadTestWeightedRoundRobin
+ dynamicThreadTestWeightedRoundRobin,
+ dynamicThreadTestLessBusy
} = require('./thread/dynamic')
const {
fixedThreadTest,
fixedThreadTestFairShare,
fixedThreadTestLessUsed,
- fixedThreadTestWeightedRoundRobin
+ fixedThreadTestWeightedRoundRobin,
+ fixedThreadTestLessBusy
} = require('./thread/fixed')
const resultsFile = 'poolifier'
Benchmark.add('Poolifier:Fixed:ThreadPool:LessUsed', async () => {
await fixedThreadTestLessUsed()
}),
+ Benchmark.add('Poolifier:Fixed:ThreadPool:LessBusy', async () => {
+ await fixedThreadTestLessBusy()
+ }),
Benchmark.add('Poolifier:Fixed:ThreadPool:WeightedRoundRobin', async () => {
await fixedThreadTestWeightedRoundRobin()
}),
Benchmark.add('Poolifier:Dynamic:ThreadPool:LessUsed', async () => {
await dynamicThreadTestLessUsed()
}),
+ Benchmark.add('Poolifier:Dynamic:ThreadPool:LessBusy', async () => {
+ await dynamicThreadTestLessBusy()
+ }),
Benchmark.add('Poolifier:Dynamic:ThreadPool:WeightedRoundRobin', async () => {
await dynamicThreadTestWeightedRoundRobin()
}),
Benchmark.add('Poolifier:Fixed:ClusterPool:LessUsed', async () => {
await fixedClusterTestLessUsed()
}),
+ Benchmark.add('Poolifier:Fixed:ClusterPool:LessBusy', async () => {
+ await fixedClusterTestLessBusy()
+ }),
Benchmark.add('Poolifier:Fixed:ClusterPool:WeightedRoundRobin', async () => {
- await fixedClusterTestWeightedRoundRobin
+ await fixedClusterTestWeightedRoundRobin()
}),
Benchmark.add('Poolifier:Fixed:ClusterPool:FairShare', async () => {
await fixedClusterTestFairShare()
Benchmark.add('Poolifier:Dynamic:ClusterPool:LessUsed', async () => {
await dynamicClusterTestLessUsed()
}),
+ Benchmark.add('Poolifier:Dynamic:ClusterPool:LessBusy', async () => {
+ await dynamicClusterTestLessBusy()
+ }),
Benchmark.add(
'Poolifier:Dynamic:ClusterPool:WeightedRoundRobin',
async () => {
- await dynamicClusterTestWeightedRoundRobin
+ await dynamicClusterTestWeightedRoundRobin()
}
),
Benchmark.add('Poolifier:Dynamic:ClusterPool:FairShare', async () => {
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
+const dynamicPoolLessBusy = new DynamicClusterPool(
+ size / 2,
+ size * 3,
+ './benchmarks/internal/cluster/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+)
+
const dynamicPoolWeightedRoundRobin = new DynamicClusterPool(
size / 2,
size * 3,
return runPoolifierTest(dynamicPoolLessUsed, { tasks, workerData })
}
+async function dynamicClusterTestLessBusy (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(dynamicPoolLessBusy, { tasks, workerData })
+}
+
async function dynamicClusterTestWeightedRoundRobin (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
dynamicClusterTest,
dynamicClusterTestLessUsed,
+ dynamicClusterTestLessBusy,
dynamicClusterTestWeightedRoundRobin,
dynamicClusterTestFairShare
}
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
+const fixedPoolLessBusy = new FixedClusterPool(
+ size,
+ './benchmarks/internal/cluster/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+)
+
const fixedPoolWeightedRoundRobin = new FixedClusterPool(
size,
'./benchmarks/internal/cluster/worker.js',
return runPoolifierTest(fixedPoolLessUsed, { tasks, workerData })
}
+async function fixedClusterTestLessBusy (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(fixedPoolLessBusy, { tasks, workerData })
+}
+
async function fixedClusterTestWeightedRoundRobin (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
fixedClusterTest,
fixedClusterTestLessUsed,
+ fixedClusterTestLessBusy,
fixedClusterTestWeightedRoundRobin,
fixedClusterTestFairShare
}
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
+const dynamicPoolLessBusy = new DynamicThreadPool(
+ size / 2,
+ size * 3,
+ './benchmarks/internal/thread/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+)
+
const dynamicPoolWeightedRoundRobin = new DynamicThreadPool(
size / 2,
size * 3,
return runPoolifierTest(dynamicPoolLessUsed, { tasks, workerData })
}
+async function dynamicThreadTestLessBusy (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(dynamicPoolLessBusy, { tasks, workerData })
+}
+
async function dynamicThreadTestWeightedRoundRobin (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
dynamicThreadTest,
dynamicThreadTestLessUsed,
+ dynamicThreadTestLessBusy,
dynamicThreadTestWeightedRoundRobin,
dynamicThreadTestFairShare
}
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
+const fixedPoolLessBusy = new FixedThreadPool(
+ size,
+ './benchmarks/internal/thread/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+)
+
const fixedPoolWeightedRoundRobin = new FixedThreadPool(
size,
'./benchmarks/internal/thread/worker.js',
return runPoolifierTest(fixedPoolLessUsed, { tasks, workerData })
}
+async function fixedThreadTestLessBusy (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(fixedPoolLessBusy, { tasks, workerData })
+}
+
async function fixedThreadTestWeightedRoundRobin (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
module.exports = {
fixedThreadTest,
fixedThreadTestLessUsed,
+ fixedThreadTestLessBusy,
fixedThreadTestWeightedRoundRobin,
fixedThreadTestFairShare
}