repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply dependencies update
[poolifier.git]
/
benchmarks
/
internal
/
thread
/
fixed.js
diff --git
a/benchmarks/internal/thread/fixed.js
b/benchmarks/internal/thread/fixed.js
index 1db9c0b6f56428ea7216d60ce448891d22b7ffa7..3f40f3fbcac920f9f4013bdb59d3c155fdb42b57 100644
(file)
--- a/
benchmarks/internal/thread/fixed.js
+++ b/
benchmarks/internal/thread/fixed.js
@@
-2,7
+2,7
@@
const {
FixedThreadPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
FixedThreadPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
-const { runPoolifierTest } = require('../
benchmark
-utils')
+const { runPoolifierTest } = require('../
../benchmarks
-utils')
const size = 30
const numberOfTasks = 1
const size = 30
const numberOfTasks = 1
@@
-18,6
+18,12
@@
const fixedPoolLessRecentlyUsed = new FixedThreadPool(
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED }
)
{ 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',
const fixedPoolFairShare = new FixedThreadPool(
size,
'./benchmarks/internal/thread/worker.js',
@@
-36,6
+42,12
@@
async function fixedThreadTestLessRecentlyUsed (
return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData })
}
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' } }
) {
async function fixedThreadTestFairShare (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
@@
-44,6
+56,7
@@
async function fixedThreadTestFairShare (
module.exports = {
fixedThreadTest,
module.exports = {
fixedThreadTest,
- fixedThreadTestFairShare,
- fixedThreadTestLessRecentlyUsed
+ fixedThreadTestLessRecentlyUsed,
+ fixedThreadTestWeightedRoundRobin,
+ fixedThreadTestFairShare
}
}