repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:poolifier/poolifier
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
threadjs.js
diff --git
a/benchmarks/versus-external-pools/threadjs.js
b/benchmarks/versus-external-pools/threadjs.js
index df5c087f547d1f2c922d661af0297f7019351392..ee9178e92b7954663efd9855f069476423d6bb06 100644
(file)
--- a/
benchmarks/versus-external-pools/threadjs.js
+++ b/
benchmarks/versus-external-pools/threadjs.js
@@
-1,11
+1,12
@@
// IMPORT LIBRARIES
// IMPORT LIBRARIES
-const { spawn,
Thread,
Worker } = require('threads')
+const { spawn, Worker } = require('threads')
// FINISH IMPORT LIBRARIES
// 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)
}
// Threads.js is not really a pool so we need to write few additional code
}
// Threads.js is not really a pool so we need to write few additional code
@@
-27,6
+28,7
@@
async function run () {
promises.push(worker.exposedFunction(data))
}
await Promise.all(promises)
promises.push(worker.exposedFunction(data))
}
await Promise.all(promises)
+ // eslint-disable-next-line n/no-process-exit
process.exit()
}
process.exit()
}