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 c89a951d2c70be00147764eeba7e78eece53bccd..8a92dbea5b6a7709f8b2df90b77f7a8ce170d394 100644
(file)
--- a/
benchmarks/versus-external-pools/fixed-piscina.js
+++ b/
benchmarks/versus-external-pools/fixed-piscina.js
@@
-1,11
+1,12
@@
// 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({
}
const piscina = new Piscina({
@@
-17,9
+18,10
@@
const piscina = new Piscina({
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()
}