refactor: remove unsupported pools
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 25 Jun 2023 19:32:05 +0000 (21:32 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 25 Jun 2023 19:32:05 +0000 (21:32 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
benchmarks/README.md
benchmarks/versus-external-pools/functions/function-to-bench.mjs
benchmarks/versus-external-pools/hyperfine_benchmarks.sh

index b2b1fb9f78f77f460ae977451595d20a07616604..8ad75e1c4d10c4e0a447026145c1bd473d8a26b8 100644 (file)
@@ -15,7 +15,7 @@ External pools with which we compared the poolifier results:
 
 - [piscina](https://github.com/piscinajs/piscina)
 - [tinypool](https://github.com/tinylibs/tinypool)
-- [node-worker-threads-pool](https://github.com/SUCHMOKUO/node-worker-threads-pool)
+- [node-worker-threads-pool](https://github.com/SUCHMOKUO/node-worker-threads-pool): removed from the benchmark because does not support ESM modules
 - [workerpool](https://github.com/josdejong/workerpool)
 - [worker-nodes](https://github.com/allegro/node-worker-nodes)
 - [threads.js](https://github.com/andywer/threads.js/)
index 325522908be66f7ed79e0c3237730114e8815161..fbe702292aecc0422cbb109642291de83e39086c 100644 (file)
@@ -1,3 +1,6 @@
+import crypto from 'crypto'
+import fs from 'fs'
+
 /**
  * The worker function to execute during pools benchmarks.
  * NOTE: This function requires to be self-contained, thread-safe and re-entrant.
@@ -5,8 +8,6 @@
  * @returns {*} The result.
  */
 export default async function functionToBench (data) {
-  const { default: crypto } = await import('crypto')
-  const { default: fs } = await import('fs')
   const TaskTypes = {
     CPU_INTENSIVE: 'CPU_INTENSIVE',
     IO_INTENSIVE: 'IO_INTENSIVE'
index 4e4996ec60eb97993eeb220b44ec114b998936d0..bc7466d098268cc3d075b88b7ba4ad7453ca770d 100755 (executable)
@@ -9,8 +9,6 @@ hyperfine --export-markdown BENCH-100000.md --min-runs 20 --prepare 'sleep 2' --
   'node dynamic-tinypool.mjs' \
   'node dynamic-workerpool.mjs' \
   'node fixed-workerpool.mjs' \
-  'node dynamic-node-worker-threads-pool.mjs' \
-  'node static-node-worker-threads-pool.mjs' \
   'node dynamic-worker-nodes.mjs' \
   'node fixed-worker-nodes.mjs' \
   'node threadjs.mjs' \