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
/
dynamic-suchmokuo-node-worker-threads-pool.js
diff --git
a/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js
b/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js
index 8bf964d24119aa5cbaf746378859a2c8065add74..0a56d1fd2326555ca7804d4850efb87670a517f2 100644
(file)
--- a/
benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js
+++ b/
benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js
@@
-1,16
+1,18
@@
// IMPORT LIBRARIES
// IMPORT LIBRARIES
-const { DynamicPool
, StaticPool
} = require('node-worker-threads-pool')
+const { DynamicPool } = require('node-worker-threads-pool')
// FINISH IMPORT LIBRARIES
// IMPORT FUNCTION TO BENCH
// FINISH IMPORT LIBRARIES
// IMPORT FUNCTION TO BENCH
-const functionToBench = require('./functions/
json-stringify
')
+const functionToBench = require('./functions/
function-to-bench
')
// FINISH IMPORT FUNCTION TO BENCH
// FINISH IMPORT FUNCTION TO BENCH
-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 = {
const data = {
- test: 'MYBENCH'
+ test: 'MYBENCH',
+ taskType: process.env.TASK_TYPE,
+ taskSize: parseInt(process.env.TASK_SIZE)
}
}
-const pool = new DynamicPool(
Number(size)
)
+const pool = new DynamicPool(
size
)
async function run () {
const promises = []
async function run () {
const promises = []
@@
-23,6
+25,7
@@
async function run () {
)
}
await Promise.all(promises)
)
}
await Promise.all(promises)
+ // eslint-disable-next-line n/no-process-exit
process.exit()
}
process.exit()
}