From: Jérôme Benoit Date: Mon, 18 Sep 2023 10:49:06 +0000 (+0200) Subject: fix: make benchmark vs. external pools self-contained X-Git-Tag: v2.7.0~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=35704ec7ad8144f0d0c1b0cdf4f87870df05dd94;p=poolifier.git fix: make benchmark vs. external pools self-contained Signed-off-by: Jérôme Benoit --- diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b9ed2479..2c346ebc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -27,7 +27,6 @@ updates: labels: - 'dependencies' - 'benchmarks' - - 'nocombine' reviewers: - 'pioardi' - 'jerome-benoit' diff --git a/.vscode/settings.json b/.vscode/settings.json index a3b7be46..22ada289 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,7 +32,6 @@ "mochawesome", "MYBENCH", "nanothreads", - "nocombine", "nproc", "octocat", "opencollective", diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index b3f326b7..79971825 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -173,16 +173,6 @@ export const LIST_FORMATTER = new Intl.ListFormat('en-US', { type: 'conjunction' }) -export const executeAsyncFn = async fn => { - try { - await fn() - } catch (e) { - console.error(e) - // eslint-disable-next-line n/no-process-exit - process.exit(1) - } -} - export const generateRandomInteger = ( max = Number.MAX_SAFE_INTEGER, min = 0 diff --git a/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs b/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs index 08535b68..c4be1ee1 100644 --- a/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs +++ b/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs @@ -1,5 +1,5 @@ import { DynamicPool } from 'node-worker-threads-pool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' import functionToBench from './functions/function-to-bench.js' const size = parseInt(process.env.POOL_SIZE) diff --git a/benchmarks/versus-external-pools/dynamic-piscina.mjs b/benchmarks/versus-external-pools/dynamic-piscina.mjs index 3f56a699..06c71779 100644 --- a/benchmarks/versus-external-pools/dynamic-piscina.mjs +++ b/benchmarks/versus-external-pools/dynamic-piscina.mjs @@ -1,5 +1,5 @@ import Piscina from 'piscina' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/dynamic-poolifier.mjs b/benchmarks/versus-external-pools/dynamic-poolifier.mjs index 33ac343c..98d21006 100644 --- a/benchmarks/versus-external-pools/dynamic-poolifier.mjs +++ b/benchmarks/versus-external-pools/dynamic-poolifier.mjs @@ -1,5 +1,5 @@ import { DynamicThreadPool } from 'poolifier' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/dynamic-tinypool.mjs b/benchmarks/versus-external-pools/dynamic-tinypool.mjs index 77b5d111..3c00b134 100644 --- a/benchmarks/versus-external-pools/dynamic-tinypool.mjs +++ b/benchmarks/versus-external-pools/dynamic-tinypool.mjs @@ -1,5 +1,5 @@ import Tinypool from 'tinypool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/dynamic-workerpool.mjs b/benchmarks/versus-external-pools/dynamic-workerpool.mjs index 0e09f1bb..f3baa446 100644 --- a/benchmarks/versus-external-pools/dynamic-workerpool.mjs +++ b/benchmarks/versus-external-pools/dynamic-workerpool.mjs @@ -1,5 +1,5 @@ import workerpool from 'workerpool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/fixed-nanothreads.mjs b/benchmarks/versus-external-pools/fixed-nanothreads.mjs index d5572059..d18f71b5 100644 --- a/benchmarks/versus-external-pools/fixed-nanothreads.mjs +++ b/benchmarks/versus-external-pools/fixed-nanothreads.mjs @@ -1,5 +1,5 @@ import { ThreadPool } from 'nanothreads' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' import functionToBench from './functions/function-to-bench.js' const size = parseInt(process.env.POOL_SIZE) diff --git a/benchmarks/versus-external-pools/fixed-piscina.mjs b/benchmarks/versus-external-pools/fixed-piscina.mjs index 97150f5e..761586ac 100644 --- a/benchmarks/versus-external-pools/fixed-piscina.mjs +++ b/benchmarks/versus-external-pools/fixed-piscina.mjs @@ -1,5 +1,5 @@ import Piscina from 'piscina' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/fixed-poolifier.mjs b/benchmarks/versus-external-pools/fixed-poolifier.mjs index 7cfd651d..5efd786e 100644 --- a/benchmarks/versus-external-pools/fixed-poolifier.mjs +++ b/benchmarks/versus-external-pools/fixed-poolifier.mjs @@ -1,5 +1,5 @@ import { FixedThreadPool } from 'poolifier' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/fixed-tinypool.mjs b/benchmarks/versus-external-pools/fixed-tinypool.mjs index 7063b5b9..307ac3b5 100644 --- a/benchmarks/versus-external-pools/fixed-tinypool.mjs +++ b/benchmarks/versus-external-pools/fixed-tinypool.mjs @@ -1,5 +1,5 @@ import Tinypool from 'tinypool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/fixed-workerpool.mjs b/benchmarks/versus-external-pools/fixed-workerpool.mjs index 6387b84e..9e016331 100644 --- a/benchmarks/versus-external-pools/fixed-workerpool.mjs +++ b/benchmarks/versus-external-pools/fixed-workerpool.mjs @@ -1,5 +1,5 @@ import workerpool from 'workerpool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) diff --git a/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs b/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs index d37677cd..db14b180 100644 --- a/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs +++ b/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs @@ -1,5 +1,5 @@ import { StaticPool } from 'node-worker-threads-pool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' import functionToBench from './functions/function-to-bench.js' const size = parseInt(process.env.POOL_SIZE) diff --git a/biome.json b/biome.json index aac8a42c..54a21abe 100644 --- a/biome.json +++ b/biome.json @@ -30,7 +30,6 @@ "files": { "ignore": [ ".nyc_output/", - ".vscode/", "benchmarks/internal/results/", "coverage/", "docs/**/*.css",