Run benchmarks versus latest external pool libraries
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 16 Oct 2022 22:15:04 +0000 (00:15 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 16 Oct 2022 22:15:04 +0000 (00:15 +0200)
Close #594

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
13 files changed:
CHANGELOG.md
benchmarks/README.md
benchmarks/versus-external-pools/BENCH-100000.md
benchmarks/versus-external-pools/dynamic-piscina.js
benchmarks/versus-external-pools/fixed-piscina.js
benchmarks/versus-external-pools/fixed-threadwork.js
benchmarks/versus-external-pools/fixed-worker-threads-pool.js [deleted file]
benchmarks/versus-external-pools/hyperfine_benchmarks.sh
benchmarks/versus-external-pools/package-lock.json
benchmarks/versus-external-pools/package.json
benchmarks/versus-external-pools/pool-threadwork.js [new file with mode: 0644]
benchmarks/versus-external-pools/threadjs.js
benchmarks/versus-external-pools/workers/worker-threads-pool/function-to-bench-worker.js [deleted file]

index 39b86b2b3a07ab958d625f7134c01ee721bbaa78..5a6e289e89074f7a387390ce59ae0614fd8049fb 100644 (file)
@@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Added
+
+- Fully automate release process with release-it.
+
 ### Changed
 
-- Optimize fair share task scheduling algorithm.
+- Optimize fair share task scheduling algorithm implementation.
+- Update benchmarks versus external pools results.
 
 ## [2.3.3] - 2022-15-10
 
index 92357060579a0c554e2ea090244aa9b612a3a546..f8d0bbddb3b660482c857b364eb99c45782797ad 100644 (file)
@@ -19,7 +19,6 @@ External pools with which we compared the poolifier results:
 - [workerpool](https://github.com/josdejong/workerpool)
 - [threadwork](https://github.com/kevlened/threadwork)
 - [microjob](https://github.com/wilk/microjob)
-<!-- - [worker-threads-pool](https://github.com/watson/worker-threads-pool) -->
 
 Those are our results:
 
index 0bb2f47275f22337ab57c1806c5cff72aa5c257b..6c2aae9c7638eaaf95d59fa1902806da76a840e4 100644 (file)
@@ -1,13 +1,13 @@
 | Command                                              |       Mean [s] | Min [s] | Max [s] |    Relative |
 | :--------------------------------------------------- | -------------: | ------: | ------: | ----------: |
-| `node dynamic-piscina.js`                            | 18.364 ± 0.203 |  18.050 |  18.737 | 1.07 ± 0.02 |
-| `node fixed-piscina.js`                              | 18.222 ± 0.519 |  17.529 |  19.164 | 1.06 ± 0.03 |
-| `node dynamic-poolifier.js`                          | 17.135 ± 0.256 |  16.926 |  17.755 |        1.00 |
-| `node fixed-poolifier.js`                            | 17.947 ± 0.489 |  17.567 |  18.951 | 1.05 ± 0.03 |
-| `node dynamic-suchmokuo-node-worker-threads-pool.js` | 25.460 ± 0.453 |  25.124 |  26.617 | 1.49 ± 0.03 |
-| `node static-suchmokuo-node-worker-threads-pool.js`  | 18.993 ± 0.714 |  18.388 |  20.610 | 1.11 ± 0.04 |
-| `node threadjs.js`                                   | 80.939 ± 3.548 |  76.881 |  88.363 | 4.72 ± 0.22 |
-| `node dynamic-workerpool.js`                         | 19.292 ± 0.110 |  19.109 |  19.480 | 1.13 ± 0.02 |
-| `node fixed-workerpool.js`                           | 19.684 ± 0.636 |  19.212 |  21.049 | 1.15 ± 0.04 |
-| `node fixed-threadwork.js`                           | 30.023 ± 0.362 |  29.524 |  30.727 | 1.75 ± 0.03 |
-| `node fixed-microjob.js`                             | 32.526 ± 0.649 |  31.696 |  33.687 | 1.90 ± 0.05 |
+| `node dynamic-piscina.js`                            | 27.917 ± 3.550 |  23.332 |  32.602 | 1.24 ± 0.17 |
+| `node fixed-piscina.js`                              | 24.073 ± 0.603 |  23.245 |  24.980 | 1.07 ± 0.06 |
+| `node dynamic-poolifier.js`                          | 22.571 ± 1.049 |  21.715 |  25.146 |        1.00 |
+| `node fixed-poolifier.js`                            | 23.344 ± 0.508 |  22.659 |  24.247 | 1.03 ± 0.05 |
+| `node dynamic-suchmokuo-node-worker-threads-pool.js` | 33.512 ± 1.607 |  32.231 |  37.384 | 1.48 ± 0.10 |
+| `node static-suchmokuo-node-worker-threads-pool.js`  | 24.475 ± 0.578 |  23.780 |  25.335 | 1.08 ± 0.06 |
+| `node threadjs.js`                                   | 92.927 ± 5.314 |  84.503 | 102.706 | 4.12 ± 0.30 |
+| `node dynamic-workerpool.js`                         | 27.519 ± 0.717 |  26.510 |  29.063 | 1.22 ± 0.06 |
+| `node fixed-workerpool.js`                           | 25.787 ± 0.620 |  25.066 |  26.622 | 1.14 ± 0.06 |
+| `node fixed-threadwork.js`                           | 24.481 ± 0.505 |  23.711 |  25.274 | 1.08 ± 0.06 |
+| `node fixed-microjob.js`                             | 41.766 ± 1.275 |  40.694 |  45.133 | 1.85 ± 0.10 |
index 83190d43cd927e708de2c356bea727958aee507b..61681dab8efa1567d7525094ad20d6bff64d0315 100644 (file)
@@ -18,7 +18,7 @@ const piscina = new Piscina({
 async function run () {
   const promises = []
   for (let i = 0; i < iterations; i++) {
-    promises.push(piscina.runTask(data))
+    promises.push(piscina.run(data))
   }
   await Promise.all(promises)
   process.exit()
index c89a951d2c70be00147764eeba7e78eece53bccd..861fe4f6b99662ca93d2a944d898f58c64f41b7a 100644 (file)
@@ -17,7 +17,7 @@ const piscina = new Piscina({
 async function run () {
   const promises = []
   for (let i = 0; i < iterations; i++) {
-    promises.push(piscina.runTask(data))
+    promises.push(piscina.run(data))
   }
   await Promise.all(promises)
   process.exit()
index fcc370ff1922f1a06b2f9b05e300872f67bc405e..eb316b5354902b231438345305089aea96fabcce 100644 (file)
@@ -1,18 +1,12 @@
 // IMPORT LIBRARIES
-const { ThreadPool } = require('threadwork')
+const threadPool = require('./pool-threadwork')
 // 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 threadPool = new ThreadPool({ task: functionToBench, size: size })
-
 async function run () {
   const promises = []
   for (let i = 0; i < iterations; i++) {
diff --git a/benchmarks/versus-external-pools/fixed-worker-threads-pool.js b/benchmarks/versus-external-pools/fixed-worker-threads-pool.js
deleted file mode 100644 (file)
index b4d9ece..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// IMPORT LIBRARIES
-const Pool = require('worker-threads-pool')
-// FINISH IMPORT LIBRARIES
-const size = Number(process.env.POOL_SIZE)
-const iterations = Number(process.env.NUM_ITERATIONS)
-const data = {
-  test: 'MYBENCH',
-  taskType: process.env['TASK_TYPE']
-}
-
-const pool = new Pool({ max: size })
-
-async function poolAcquireAsync () {
-  return new Promise((resolve, reject) => {
-    pool.acquire(
-      './workers/worker-threads-pool/function-to-bench-worker.js',
-      {
-        workerData: data
-      },
-      err => {
-        if (err) reject(err)
-        resolve()
-      }
-    )
-  })
-}
-
-async function run () {
-  const promises = []
-  for (let i = 0; i < iterations; i++) {
-    promises.push(poolAcquireAsync())
-  }
-  await Promise.all(promises)
-  process.exit()
-}
-
-run()
index 7ab3bf3f5336f25021a13ca7eb28c759adb1826b..1ac1beda0e87f332581410b5dc684a0280f99ee5 100755 (executable)
@@ -12,7 +12,6 @@ hyperfine --export-markdown BENCH-100000.md --min-runs 10 \
   'node dynamic-workerpool.js' \
   'node fixed-workerpool.js' \
   'node fixed-threadwork.js' \
-  'node fixed-microjob.js' \
-  # 'node fixed-worker-threads-pool.js'
+  'node fixed-microjob.js'
 
 
index 1e9840f81cb290d864481a3e9edc67f3ab980f9c..0dce8f65dcd1e4730b47beaa02b67a1d2d8b9c69 100644 (file)
@@ -9,13 +9,12 @@
       "version": "1.0.0-internal",
       "dependencies": {
         "microjob": "0.7.0",
-        "node-worker-threads-pool": "1.4.3",
-        "piscina": "3.0.0",
-        "poolifier": "2.0.1",
-        "threads": "1.6.4",
+        "node-worker-threads-pool": "1.5.1",
+        "piscina": "3.2.0",
+        "poolifier": "2.3.3",
+        "threads": "1.7.0",
         "threadwork": "0.6.0",
-        "worker-threads-pool": "2.0.0",
-        "workerpool": "6.1.4"
+        "workerpool": "6.2.1"
       }
     },
     "node_modules/@assemblyscript/loader": {
       "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
       "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg=="
     },
-    "node_modules/after-all": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/after-all/-/after-all-2.0.2.tgz",
-      "integrity": "sha1-IDACmO1glLTIXJjnyK1NymKPn3M=",
-      "dependencies": {
-        "once": "^1.3.0"
-      }
-    },
     "node_modules/base64-js": {
       "version": "1.5.1",
       "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
       }
     },
     "node_modules/node-worker-threads-pool": {
-      "version": "1.4.3",
-      "resolved": "https://registry.npmjs.org/node-worker-threads-pool/-/node-worker-threads-pool-1.4.3.tgz",
-      "integrity": "sha512-US55ZGzEDQY2oq8Bc33dFVNKGpx4KaCJqThMDomSsUeX8tMdp2eDjQ6OP0yFd1HTEuHuLqxXSTWC4eidEsbXlg=="
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/node-worker-threads-pool/-/node-worker-threads-pool-1.5.1.tgz",
+      "integrity": "sha512-7TXAhpMm+jO4MfESxYLtMGSnJWv+itdNHMdaFmeZuPXxwFGU90mtEB42BciUULXOUAxYBfXILAuvrSG3rQZ7mw=="
     },
     "node_modules/observable-fns": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.5.1.tgz",
-      "integrity": "sha512-wf7g4Jpo1Wt2KIqZKLGeiuLOEMqpaOZ5gJn7DmSdqXgTdxRwSdBhWegQQpPteQ2gZvzCKqNNpwb853wcpA0j7A=="
-    },
-    "node_modules/once": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
-      "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
-      "dependencies": {
-        "wrappy": "1"
-      }
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.6.1.tgz",
+      "integrity": "sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg=="
     },
     "node_modules/p-limit": {
       "version": "3.1.0",
       }
     },
     "node_modules/piscina": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/piscina/-/piscina-3.0.0.tgz",
-      "integrity": "sha512-ye56YiBCK3loPGsagK/Sf/aeuCPAkvZIJDGQnv+SSOQUz1Od5cUsDeirQBB0cxFkXCY6FDsk36Z9xX1D2Zb8Zw==",
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/piscina/-/piscina-3.2.0.tgz",
+      "integrity": "sha512-yn/jMdHRw+q2ZJhFhyqsmANcbF6V2QwmD84c6xRau+QpQOmtrBCoRGdvTfeuFDYXB5W2m6MfLkjkvQa9lUSmIA==",
       "dependencies": {
         "eventemitter-asyncresource": "^1.0.0",
         "hdr-histogram-js": "^2.0.1",
       }
     },
     "node_modules/poolifier": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.0.1.tgz",
-      "integrity": "sha512-klkLv35QVumXKrQj6Totvwqb0lw34j7mIsEm8uZXXHlcpVCvnhhgVFVyuZUOSNTjZnBCaiB0KcLos03cqj38CA==",
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.3.3.tgz",
+      "integrity": "sha512-mxkMpqPMHtdGeJfBe7iXRkIlcXJNYNuCPCw0sLhch8k7sFGGk0pby5eToGVwBx6Yxc0o7aCR5JU1blnFLl8Igg==",
       "engines": {
-        "node": ">=12.11.0",
-        "npm": ">=6.0.0 <7"
+        "node": ">=16.0.0",
+        "npm": ">=8.0.0"
       }
     },
     "node_modules/threads": {
-      "version": "1.6.4",
-      "resolved": "https://registry.npmjs.org/threads/-/threads-1.6.4.tgz",
-      "integrity": "sha512-A+9MQFAUha9W8MjIPmrvETy98qVmZFr5Unox9D95y7kvz3fBpGiFS7JOZs07B2KvTHoRNI5MrGudRVeCmv4Alw==",
+      "version": "1.7.0",
+      "resolved": "https://registry.npmjs.org/threads/-/threads-1.7.0.tgz",
+      "integrity": "sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==",
       "dependencies": {
         "callsites": "^3.1.0",
         "debug": "^4.2.0",
         "is-observable": "^2.1.0",
-        "observable-fns": "^0.5.1"
+        "observable-fns": "^0.6.1"
       },
       "funding": {
         "url": "https://github.com/andywer/threads.js?sponsor=1"
         "esm": "^3.2.25"
       }
     },
-    "node_modules/worker-threads-pool": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/worker-threads-pool/-/worker-threads-pool-2.0.0.tgz",
-      "integrity": "sha512-5dtGbEucee6o5/kQgpyKIUoHGWf8488DP3ihZDJzDIVvH4V+NA6HdBl/I5ckI4yN1NwM68pdZDbrwac1M95mEA==",
-      "dependencies": {
-        "after-all": "^2.0.2"
-      },
-      "engines": {
-        "node": ">=10.5.0"
-      }
-    },
     "node_modules/workerpool": {
-      "version": "6.1.4",
-      "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.4.tgz",
-      "integrity": "sha512-jGWPzsUqzkow8HoAvqaPWTUPCrlPJaJ5tY8Iz7n1uCz3tTp6s3CDG0FF1NsX42WNlkRSW6Mr+CDZGnNoSsKa7g=="
-    },
-    "node_modules/wrappy": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
-      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
+      "version": "6.2.1",
+      "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
+      "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw=="
     },
     "node_modules/yocto-queue": {
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
       "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg=="
     },
-    "after-all": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/after-all/-/after-all-2.0.2.tgz",
-      "integrity": "sha1-IDACmO1glLTIXJjnyK1NymKPn3M=",
-      "requires": {
-        "once": "^1.3.0"
-      }
-    },
     "base64-js": {
       "version": "1.5.1",
       "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
       "optional": true
     },
     "node-worker-threads-pool": {
-      "version": "1.4.3",
-      "resolved": "https://registry.npmjs.org/node-worker-threads-pool/-/node-worker-threads-pool-1.4.3.tgz",
-      "integrity": "sha512-US55ZGzEDQY2oq8Bc33dFVNKGpx4KaCJqThMDomSsUeX8tMdp2eDjQ6OP0yFd1HTEuHuLqxXSTWC4eidEsbXlg=="
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/node-worker-threads-pool/-/node-worker-threads-pool-1.5.1.tgz",
+      "integrity": "sha512-7TXAhpMm+jO4MfESxYLtMGSnJWv+itdNHMdaFmeZuPXxwFGU90mtEB42BciUULXOUAxYBfXILAuvrSG3rQZ7mw=="
     },
     "observable-fns": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.5.1.tgz",
-      "integrity": "sha512-wf7g4Jpo1Wt2KIqZKLGeiuLOEMqpaOZ5gJn7DmSdqXgTdxRwSdBhWegQQpPteQ2gZvzCKqNNpwb853wcpA0j7A=="
-    },
-    "once": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
-      "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
-      "requires": {
-        "wrappy": "1"
-      }
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.6.1.tgz",
+      "integrity": "sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg=="
     },
     "p-limit": {
       "version": "3.1.0",
       "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
     },
     "piscina": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/piscina/-/piscina-3.0.0.tgz",
-      "integrity": "sha512-ye56YiBCK3loPGsagK/Sf/aeuCPAkvZIJDGQnv+SSOQUz1Od5cUsDeirQBB0cxFkXCY6FDsk36Z9xX1D2Zb8Zw==",
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/piscina/-/piscina-3.2.0.tgz",
+      "integrity": "sha512-yn/jMdHRw+q2ZJhFhyqsmANcbF6V2QwmD84c6xRau+QpQOmtrBCoRGdvTfeuFDYXB5W2m6MfLkjkvQa9lUSmIA==",
       "requires": {
         "eventemitter-asyncresource": "^1.0.0",
         "hdr-histogram-js": "^2.0.1",
       }
     },
     "poolifier": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.0.1.tgz",
-      "integrity": "sha512-klkLv35QVumXKrQj6Totvwqb0lw34j7mIsEm8uZXXHlcpVCvnhhgVFVyuZUOSNTjZnBCaiB0KcLos03cqj38CA=="
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.3.3.tgz",
+      "integrity": "sha512-mxkMpqPMHtdGeJfBe7iXRkIlcXJNYNuCPCw0sLhch8k7sFGGk0pby5eToGVwBx6Yxc0o7aCR5JU1blnFLl8Igg=="
     },
     "threads": {
-      "version": "1.6.4",
-      "resolved": "https://registry.npmjs.org/threads/-/threads-1.6.4.tgz",
-      "integrity": "sha512-A+9MQFAUha9W8MjIPmrvETy98qVmZFr5Unox9D95y7kvz3fBpGiFS7JOZs07B2KvTHoRNI5MrGudRVeCmv4Alw==",
+      "version": "1.7.0",
+      "resolved": "https://registry.npmjs.org/threads/-/threads-1.7.0.tgz",
+      "integrity": "sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==",
       "requires": {
         "callsites": "^3.1.0",
         "debug": "^4.2.0",
         "is-observable": "^2.1.0",
-        "observable-fns": "^0.5.1",
+        "observable-fns": "^0.6.1",
         "tiny-worker": ">= 2"
       }
     },
         "esm": "^3.2.25"
       }
     },
-    "worker-threads-pool": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/worker-threads-pool/-/worker-threads-pool-2.0.0.tgz",
-      "integrity": "sha512-5dtGbEucee6o5/kQgpyKIUoHGWf8488DP3ihZDJzDIVvH4V+NA6HdBl/I5ckI4yN1NwM68pdZDbrwac1M95mEA==",
-      "requires": {
-        "after-all": "^2.0.2"
-      }
-    },
     "workerpool": {
-      "version": "6.1.4",
-      "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.4.tgz",
-      "integrity": "sha512-jGWPzsUqzkow8HoAvqaPWTUPCrlPJaJ5tY8Iz7n1uCz3tTp6s3CDG0FF1NsX42WNlkRSW6Mr+CDZGnNoSsKa7g=="
-    },
-    "wrappy": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
-      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
+      "version": "6.2.1",
+      "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
+      "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw=="
     },
     "yocto-queue": {
       "version": "0.1.0",
index a3b7f0ef1e62741e1b16c643f8e2b2aec64d3a7b..fe74923a4efeaf79067258a18f068263fe126397 100644 (file)
   },
   "dependencies": {
     "microjob": "0.7.0",
-    "node-worker-threads-pool": "1.4.3",
-    "piscina": "3.0.0",
-    "poolifier": "2.0.1",
-    "threads": "1.6.4",
+    "node-worker-threads-pool": "1.5.1",
+    "piscina": "3.2.0",
+    "poolifier": "2.3.3",
+    "threads": "1.7.0",
     "threadwork": "0.6.0",
-    "worker-threads-pool": "2.0.0",
-    "workerpool": "6.1.4"
+    "workerpool": "6.2.1"
   }
 }
diff --git a/benchmarks/versus-external-pools/pool-threadwork.js b/benchmarks/versus-external-pools/pool-threadwork.js
new file mode 100644 (file)
index 0000000..5e5e04e
--- /dev/null
@@ -0,0 +1,9 @@
+// IMPORT LIBRARIES
+const { ThreadPool } = require('threadwork')
+// 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)
+
+module.exports = new ThreadPool({ task: functionToBench, size: size })
index 2cc96d574e6b600a876535723ca3b536373ef4d4..18a01cfd9492ec0b462d39550189fdaa9adbf9c5 100644 (file)
@@ -1,5 +1,5 @@
 // IMPORT LIBRARIES
-const { spawn, Thread, Worker } = require('threads')
+const { spawn, Worker } = require('threads')
 // FINISH IMPORT LIBRARIES
 const size = Number(process.env.POOL_SIZE)
 const iterations = Number(process.env.NUM_ITERATIONS)
diff --git a/benchmarks/versus-external-pools/workers/worker-threads-pool/function-to-bench-worker.js b/benchmarks/versus-external-pools/workers/worker-threads-pool/function-to-bench-worker.js
deleted file mode 100644 (file)
index 202eeb3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict'
-const { workerData } = require('worker_threads')
-const functionToBench = require('../../functions/function-to-bench')
-functionToBench(workerData)