repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): apply updates
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
dynamic-piscina.js
diff --git
a/benchmarks/versus-external-pools/dynamic-piscina.js
b/benchmarks/versus-external-pools/dynamic-piscina.js
index 0881d1d051c9f69914c8ff300e69c30e843166a2..6b835d0ee37239460ca81c00564292da647cb224 100644
(file)
--- a/
benchmarks/versus-external-pools/dynamic-piscina.js
+++ b/
benchmarks/versus-external-pools/dynamic-piscina.js
@@
-1,26
+1,28
@@
// IMPORT LIBRARIES
const Piscina = require('piscina')
// FINISH IMPORT LIBRARIES
// IMPORT LIBRARIES
const Piscina = require('piscina')
// FINISH IMPORT LIBRARIES
-const size = p
rocess.env.POOL_SIZE
-const iterations = p
rocess.env.NUM_ITERATIONS
+const size = p
arseInt(process.env.POOL_SIZE)
+const iterations = p
arseInt(process.env.NUM_ITERATIONS)
const data = {
test: 'MYBENCH',
const data = {
test: 'MYBENCH',
- taskType: process.env['TASK_TYPE']
+ taskType: process.env.TASK_TYPE,
+ taskSize: parseInt(process.env.TASK_SIZE)
}
const piscina = new Piscina({
filename: './workers/piscina/function-to-bench-worker.js',
}
const piscina = new Piscina({
filename: './workers/piscina/function-to-bench-worker.js',
- minThreads:
Number(size)
,
+ minThreads:
size
,
maxThreads: size * 3,
maxThreads: size * 3,
- idleTimeout:
1000 * 6
0 // this is the same as poolifier default
+ idleTimeout:
6000
0 // this is the same as poolifier default
})
async function run () {
const promises = []
for (let i = 0; i < iterations; i++) {
})
async function run () {
const promises = []
for (let i = 0; i < iterations; i++) {
- promises.push(piscina.run
Task
(data))
+ promises.push(piscina.run(data))
}
await Promise.all(promises)
}
await Promise.all(promises)
+ // eslint-disable-next-line n/no-process-exit
process.exit()
}
process.exit()
}