repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert function to arrow function in UT
[poolifier.git]
/
benchmarks
/
internal
/
thread
/
dynamic.js
diff --git
a/benchmarks/internal/thread/dynamic.js
b/benchmarks/internal/thread/dynamic.js
index bc9b3d8194e91e14305419eb2265bc4bced929b3..290820778e44ec7df7d2b2f2101b9dafeef4cb8c 100644
(file)
--- a/
benchmarks/internal/thread/dynamic.js
+++ b/
benchmarks/internal/thread/dynamic.js
@@
-2,9
+2,10
@@
const {
DynamicThreadPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
DynamicThreadPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
-const { runTest } = require('../benchmark-utils')
+const { run
Poolifier
Test } = require('../benchmark-utils')
const size = 30
const size = 30
+const numberOfTasks = 1
const dynamicPool = new DynamicThreadPool(
size / 2,
const dynamicPool = new DynamicThreadPool(
size / 2,
@@
-16,19
+17,19
@@
const dynamicPoolLessRecentlyUsed = new DynamicThreadPool(
size / 2,
size * 3,
'./benchmarks/internal/thread/worker.js',
size / 2,
size * 3,
'./benchmarks/internal/thread/worker.js',
- { workerChoiceStrategy:
DynamicThreadPool
.LESS_RECENTLY_USED }
+ { workerChoiceStrategy:
WorkerChoiceStrategies
.LESS_RECENTLY_USED }
)
async function dynamicThreadTest (
)
async function dynamicThreadTest (
- { tasks, workerData } = { tasks:
1
, workerData: { proof: 'ok' } }
+ { tasks, workerData } = { tasks:
numberOfTasks
, workerData: { proof: 'ok' } }
) {
) {
- return runTest(dynamicPool, { tasks, workerData })
+ return run
Poolifier
Test(dynamicPool, { tasks, workerData })
}
async function dynamicThreadTestLessRecentlyUsed (
}
async function dynamicThreadTestLessRecentlyUsed (
- { tasks, workerData } = { tasks:
1
, workerData: { proof: 'ok' } }
+ { tasks, workerData } = { tasks:
numberOfTasks
, workerData: { proof: 'ok' } }
) {
) {
- return runTest(dynamicPoolLessRecentlyUsed, { tasks, workerData })
+ return run
Poolifier
Test(dynamicPoolLessRecentlyUsed, { tasks, workerData })
}
module.exports = {
}
module.exports = {