From: Jérôme Benoit Date: Sun, 25 Jun 2023 22:43:17 +0000 (+0200) Subject: fix: resolve import for worker-nodes X-Git-Tag: v2.6.4~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=479ca1f2da1c122f9558edcd386f8aa5147f44e2;p=poolifier.git fix: resolve import for worker-nodes Signed-off-by: Jérôme Benoit --- diff --git a/benchmarks/versus-external-pools/dynamic-worker-nodes.mjs b/benchmarks/versus-external-pools/dynamic-worker-nodes.mjs index a2622f9c..5404c9b8 100644 --- a/benchmarks/versus-external-pools/dynamic-worker-nodes.mjs +++ b/benchmarks/versus-external-pools/dynamic-worker-nodes.mjs @@ -1,5 +1,4 @@ // IMPORT LIBRARIES -import { resolve } from 'path' import WorkerNodes from 'worker-nodes' // FINISH IMPORT LIBRARIES const size = parseInt(process.env.POOL_SIZE) @@ -11,7 +10,7 @@ const data = { } const workerNodes = new WorkerNodes( - resolve('./workers/worker-nodes/function-to-bench-worker'), + import.meta.resolve('./workers/worker-nodes/function-to-bench-worker'), { minWorkers: size, maxWorkers: size * 3, diff --git a/benchmarks/versus-external-pools/fixed-worker-nodes.mjs b/benchmarks/versus-external-pools/fixed-worker-nodes.mjs index 67885117..bffef10c 100644 --- a/benchmarks/versus-external-pools/fixed-worker-nodes.mjs +++ b/benchmarks/versus-external-pools/fixed-worker-nodes.mjs @@ -1,5 +1,4 @@ // IMPORT LIBRARIES -import { resolve } from 'path' import WorkerNodes from 'worker-nodes' // FINISH IMPORT LIBRARIES const size = parseInt(process.env.POOL_SIZE) @@ -11,7 +10,7 @@ const data = { } const workerNodes = new WorkerNodes( - resolve('./workers/worker-nodes/function-to-bench-worker'), + import.meta.resolve('./workers/worker-nodes/function-to-bench-worker'), { minWorkers: size, maxWorkers: size, diff --git a/benchmarks/versus-external-pools/hyperfine_benchmarks.sh b/benchmarks/versus-external-pools/hyperfine_benchmarks.sh index bc7466d0..b73ccaf4 100755 --- a/benchmarks/versus-external-pools/hyperfine_benchmarks.sh +++ b/benchmarks/versus-external-pools/hyperfine_benchmarks.sh @@ -9,8 +9,8 @@ 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-worker-nodes.mjs' \ - 'node fixed-worker-nodes.mjs' \ + 'node --experimental-import-meta-resolve dynamic-worker-nodes.mjs' \ + 'node --experimental-import-meta-resolve fixed-worker-nodes.mjs' \ 'node threadjs.mjs' \ 'node fixed-threadwork.mjs' \ 'node fixed-microjob.mjs'