From 3b314e4d3ac8d5023266c0c2e217a98886ea9ac7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 25 Jun 2023 21:32:05 +0200 Subject: [PATCH] refactor: remove unsupported pools MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- benchmarks/README.md | 2 +- .../versus-external-pools/functions/function-to-bench.mjs | 5 +++-- benchmarks/versus-external-pools/hyperfine_benchmarks.sh | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/benchmarks/README.md b/benchmarks/README.md index b2b1fb9f..8ad75e1c 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -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/) diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.mjs b/benchmarks/versus-external-pools/functions/function-to-bench.mjs index 32552290..fbe70229 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.mjs +++ b/benchmarks/versus-external-pools/functions/function-to-bench.mjs @@ -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' diff --git a/benchmarks/versus-external-pools/hyperfine_benchmarks.sh b/benchmarks/versus-external-pools/hyperfine_benchmarks.sh index 4e4996ec..bc7466d0 100755 --- a/benchmarks/versus-external-pools/hyperfine_benchmarks.sh +++ b/benchmarks/versus-external-pools/hyperfine_benchmarks.sh @@ -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' \ -- 2.34.1