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): bump @types/node
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
static-node-worker-threads-pool.mjs
diff --git
a/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs
b/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs
index 3275d6f26e3a9a75574c4e0b961375a953fcf1f4..db14b180e6633461542a96a1df9f6b270e32bf80 100644
(file)
--- a/
benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs
+++ b/
benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs
@@
-1,5
+1,5
@@
import { StaticPool } from 'node-worker-threads-pool'
import { StaticPool } from 'node-worker-threads-pool'
-import { executeAsyncFn } from '.
./benchmarks-
utils.mjs'
+import { executeAsyncFn } from '.
/
utils.mjs'
import functionToBench from './functions/function-to-bench.js'
const size = parseInt(process.env.POOL_SIZE)
import functionToBench from './functions/function-to-bench.js'
const size = parseInt(process.env.POOL_SIZE)
@@
-10,7
+10,7
@@
const data = {
taskSize: parseInt(process.env.TASK_SIZE)
}
taskSize: parseInt(process.env.TASK_SIZE)
}
-const
p
ool = new StaticPool({
+const
staticP
ool = new StaticPool({
size,
task: functionToBench
})
size,
task: functionToBench
})
@@
-18,7
+18,7
@@
const pool = new StaticPool({
async function run () {
const promises = new Set()
for (let i = 0; i < iterations; i++) {
async function run () {
const promises = new Set()
for (let i = 0; i < iterations; i++) {
- promises.add(
p
ool.exec(data))
+ promises.add(
staticP
ool.exec(data))
}
await Promise.all(promises)
// eslint-disable-next-line n/no-process-exit
}
await Promise.all(promises)
// eslint-disable-next-line n/no-process-exit