repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Run benchmarks versus latest external pool libraries
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
fixed-threadwork.js
diff --git
a/benchmarks/versus-external-pools/fixed-threadwork.js
b/benchmarks/versus-external-pools/fixed-threadwork.js
index fcc370ff1922f1a06b2f9b05e300872f67bc405e..eb316b5354902b231438345305089aea96fabcce 100644
(file)
--- a/
benchmarks/versus-external-pools/fixed-threadwork.js
+++ b/
benchmarks/versus-external-pools/fixed-threadwork.js
@@
-1,18
+1,12
@@
// IMPORT LIBRARIES
// IMPORT LIBRARIES
-const
{ ThreadPool } = require('
threadwork')
+const
threadPool = require('./pool-
threadwork')
// FINISH IMPORT LIBRARIES
// FINISH IMPORT LIBRARIES
-// IMPORT FUNCTION TO BENCH
-const functionToBench = require('./functions/function-to-bench')
-// FINISH IMPORT FUNCTION TO BENCH
-const size = Number(process.env.POOL_SIZE)
const iterations = Number(process.env.NUM_ITERATIONS)
const data = {
test: 'MYBENCH',
taskType: process.env['TASK_TYPE']
}
const iterations = Number(process.env.NUM_ITERATIONS)
const data = {
test: 'MYBENCH',
taskType: process.env['TASK_TYPE']
}
-const threadPool = new ThreadPool({ task: functionToBench, size: size })
-
async function run () {
const promises = []
for (let i = 0; i < iterations; i++) {
async function run () {
const promises = []
for (let i = 0; i < iterations; i++) {