repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: v2.4.0
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
fixed-piscina.js
diff --git
a/benchmarks/versus-external-pools/fixed-piscina.js
b/benchmarks/versus-external-pools/fixed-piscina.js
index d1f785edeb31f1ff21870d13b987e8234597a22b..8a92dbea5b6a7709f8b2df90b77f7a8ce170d394 100644
(file)
--- a/
benchmarks/versus-external-pools/fixed-piscina.js
+++ b/
benchmarks/versus-external-pools/fixed-piscina.js
@@
-1,25
+1,27
@@
// IMPORT LIBRARIES
const Piscina = require('piscina')
// FINISH IMPORT LIBRARIES
// IMPORT LIBRARIES
const Piscina = require('piscina')
// FINISH IMPORT LIBRARIES
-const size =
Number
(process.env.POOL_SIZE)
-const iterations =
Number
(process.env.NUM_ITERATIONS)
+const size =
parseInt
(process.env.POOL_SIZE)
+const iterations =
parseInt
(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',
minThreads: size,
}
const piscina = new Piscina({
filename: './workers/piscina/function-to-bench-worker.js',
minThreads: size,
- 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()
}