From 7dfbda36b5c996c25f30a0bf9261de5383c9acd4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 25 Jun 2023 00:17:29 +0200 Subject: [PATCH] refactor: cleanup benchmarks code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- benchmarks/README.md | 5 ++-- .../versus-external-pools/BENCH-100000.md | 30 +++++++++---------- ...js => dynamic-node-worker-threads-pool.js} | 0 .../hyperfine_benchmarks.sh | 4 +-- ....js => static-node-worker-threads-pool.js} | 0 5 files changed, 20 insertions(+), 19 deletions(-) rename benchmarks/versus-external-pools/{dynamic-suchmokuo-node-worker-threads-pool.js => dynamic-node-worker-threads-pool.js} (100%) rename benchmarks/versus-external-pools/{static-suchmokuo-node-worker-threads-pool.js => static-node-worker-threads-pool.js} (100%) diff --git a/benchmarks/README.md b/benchmarks/README.md index 52343a8f..b2b1fb9f 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -15,9 +15,10 @@ External pools with which we compared the poolifier results: - [piscina](https://github.com/piscinajs/piscina) - [tinypool](https://github.com/tinylibs/tinypool) -- [SUCHMOKUO/node-worker-threads-pool](https://github.com/SUCHMOKUO/node-worker-threads-pool) -- [threads.js](https://github.com/andywer/threads.js/) +- [node-worker-threads-pool](https://github.com/SUCHMOKUO/node-worker-threads-pool) - [workerpool](https://github.com/josdejong/workerpool) +- [worker-nodes](https://github.com/allegro/node-worker-nodes) +- [threads.js](https://github.com/andywer/threads.js/) - [threadwork](https://github.com/kevlened/threadwork) - [microjob](https://github.com/wilk/microjob) diff --git a/benchmarks/versus-external-pools/BENCH-100000.md b/benchmarks/versus-external-pools/BENCH-100000.md index ec3dd22c..bee11bc6 100644 --- a/benchmarks/versus-external-pools/BENCH-100000.md +++ b/benchmarks/versus-external-pools/BENCH-100000.md @@ -1,15 +1,15 @@ -| Command | Mean [s] | Min [s] | Max [s] | Relative | -| :--------------------------------------------------- | -------------: | ------: | ------: | ----------: | -| `node dynamic-poolifier.js` | 13.859 ± 0.196 | 13.531 | 14.551 | 1.01 ± 0.02 | -| `node fixed-poolifier.js` | 13.668 ± 0.200 | 13.469 | 14.397 | 1.00 | -| `node dynamic-piscina.js` | 14.736 ± 0.272 | 14.550 | 15.856 | 1.08 ± 0.03 | -| `node fixed-piscina.js` | 15.851 ± 0.151 | 15.696 | 16.281 | 1.16 ± 0.02 | -| `node fixed-tinypool.mjs` | 15.852 ± 0.154 | 15.713 | 16.368 | 1.16 ± 0.02 | -| `node dynamic-tinypool.mjs` | 14.739 ± 0.208 | 14.583 | 15.542 | 1.08 ± 0.02 | -| `node dynamic-workerpool.js` | 16.186 ± 0.322 | 15.963 | 17.167 | 1.18 ± 0.03 | -| `node fixed-workerpool.js` | 16.692 ± 0.190 | 16.529 | 17.447 | 1.22 ± 0.02 | -| `node dynamic-suchmokuo-node-worker-threads-pool.js` | 24.222 ± 0.324 | 23.931 | 25.367 | 1.77 ± 0.04 | -| `node static-suchmokuo-node-worker-threads-pool.js` | 16.335 ± 0.159 | 16.151 | 16.792 | 1.20 ± 0.02 | -| `node threadjs.js` | 45.991 ± 2.175 | 43.177 | 51.792 | 3.36 ± 0.17 | -| `node fixed-threadwork.js` | 15.833 ± 0.223 | 15.648 | 16.737 | 1.16 ± 0.02 | -| `node fixed-microjob.js` | 32.282 ± 0.411 | 31.831 | 33.153 | 2.36 ± 0.05 | +| Command | Mean [s] | Min [s] | Max [s] | Relative | +| :----------------------------------------- | -------------: | ------: | ------: | ----------: | +| `node dynamic-poolifier.js` | 13.859 ± 0.196 | 13.531 | 14.551 | 1.01 ± 0.02 | +| `node fixed-poolifier.js` | 13.668 ± 0.200 | 13.469 | 14.397 | 1.00 | +| `node dynamic-piscina.js` | 14.736 ± 0.272 | 14.550 | 15.856 | 1.08 ± 0.03 | +| `node fixed-piscina.js` | 15.851 ± 0.151 | 15.696 | 16.281 | 1.16 ± 0.02 | +| `node fixed-tinypool.mjs` | 15.852 ± 0.154 | 15.713 | 16.368 | 1.16 ± 0.02 | +| `node dynamic-tinypool.mjs` | 14.739 ± 0.208 | 14.583 | 15.542 | 1.08 ± 0.02 | +| `node dynamic-workerpool.js` | 16.186 ± 0.322 | 15.963 | 17.167 | 1.18 ± 0.03 | +| `node fixed-workerpool.js` | 16.692 ± 0.190 | 16.529 | 17.447 | 1.22 ± 0.02 | +| `node dynamic-node-worker-threads-pool.js` | 24.222 ± 0.324 | 23.931 | 25.367 | 1.77 ± 0.04 | +| `node static-node-worker-threads-pool.js` | 16.335 ± 0.159 | 16.151 | 16.792 | 1.20 ± 0.02 | +| `node threadjs.js` | 45.991 ± 2.175 | 43.177 | 51.792 | 3.36 ± 0.17 | +| `node fixed-threadwork.js` | 15.833 ± 0.223 | 15.648 | 16.737 | 1.16 ± 0.02 | +| `node fixed-microjob.js` | 32.282 ± 0.411 | 31.831 | 33.153 | 2.36 ± 0.05 | diff --git a/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js b/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.js similarity index 100% rename from benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js rename to benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.js diff --git a/benchmarks/versus-external-pools/hyperfine_benchmarks.sh b/benchmarks/versus-external-pools/hyperfine_benchmarks.sh index 7ea03998..44bce77c 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.js' \ 'node fixed-workerpool.js' \ - 'node dynamic-suchmokuo-node-worker-threads-pool.js' \ - 'node static-suchmokuo-node-worker-threads-pool.js' \ + 'node dynamic-node-worker-threads-pool.js' \ + 'node static-node-worker-threads-pool.js' \ 'node threadjs.js' \ 'node fixed-threadwork.js' \ 'node fixed-microjob.js' \ diff --git a/benchmarks/versus-external-pools/static-suchmokuo-node-worker-threads-pool.js b/benchmarks/versus-external-pools/static-node-worker-threads-pool.js similarity index 100% rename from benchmarks/versus-external-pools/static-suchmokuo-node-worker-threads-pool.js rename to benchmarks/versus-external-pools/static-node-worker-threads-pool.js -- 2.34.1