From 00a2ffdbeeb43b5f0f04b759b1173cbe1c751a5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 26 Nov 2023 22:14:49 +0100 Subject: [PATCH] perf: align benchmark v8 memory tunables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- benchmarks/benchmarks-utils.js | 3 +-- benchmarks/internal/bench.mjs | 3 +++ package.json | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/benchmarks/benchmarks-utils.js b/benchmarks/benchmarks-utils.js index d779f8a7..8f5468bb 100644 --- a/benchmarks/benchmarks-utils.js +++ b/benchmarks/benchmarks-utils.js @@ -153,10 +153,9 @@ const runPoolifierPoolBenchmark = async ( 'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name')) ) - // FIXME: destroy() hangs const destroyTimeout = setTimeout(() => { + console.error('Pool destroy timeout reached (30s)') resolve() - clearTimeout(destroyTimeout) }, 30000) pool .destroy() diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index adff3615..5ea11e18 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -1,3 +1,4 @@ +import { exit } from 'node:process' import { PoolTypes, WorkerTypes, @@ -60,3 +61,5 @@ await runPoolifierPoolBenchmark( workerData } ) + +exit() diff --git a/package.json b/package.json index 62477b59..67abe685 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,9 @@ "build:prod": "rollup --config", "build:typedoc": "rollup --config --environment DOCUMENTATION,BUILD:development", "build:analyze": "rollup --config --environment ANALYZE,BUILD:development", - "benchmark": "pnpm build && node --max-old-space-size=4096 --enable-source-maps benchmarks/internal/bench.mjs", - "benchmark:prod": "pnpm build:prod && node --max-old-space-size=4096 --enable-source-maps benchmarks/internal/bench.mjs", - "benchmark:debug": "pnpm build && node --max-old-space-size=4096 --enable-source-maps --inspect benchmarks/internal/bench.mjs", + "benchmark": "pnpm build && node --max-old-space-size=8192 --enable-source-maps benchmarks/internal/bench.mjs", + "benchmark:prod": "pnpm build:prod && node --max-old-space-size=8192 --enable-source-maps benchmarks/internal/bench.mjs", + "benchmark:debug": "pnpm build && node --max-old-space-size=8192 --enable-source-maps --inspect benchmarks/internal/bench.mjs", "test": "pnpm build --environment SOURCEMAP:false && c8 mocha 'tests/**/*.test.mjs'", "test:debug": "pnpm build && mocha --no-parallel --inspect 'tests/**/*.test.mjs'", "coverage": "c8 report --reporter=lcov", -- 2.34.1