From 36380eb53dd6b48678a70a69aba0bccfd368e108 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Sun, 19 Nov 2023 14:33:59 +0800 Subject: [PATCH] benchmark: increase the iteration number to an appropriate value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current iteration number is too small that fwrite occupies large portion of execution time which made crypo execution time measured inaccurate. The iteration above 1e5 makes 50% higher and stable score. PR-URL: https://github.com/nodejs/node/pull/50766 Reviewed-By: Debadree Chatterjee Reviewed-By: Filip Skokan Reviewed-By: Vinícius Lourenço Claro Cardoso --- benchmark/crypto/webcrypto-digest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/crypto/webcrypto-digest.js b/benchmark/crypto/webcrypto-digest.js index e2e6f55c6fdd1f..f5ef8e6bc49385 100644 --- a/benchmark/crypto/webcrypto-digest.js +++ b/benchmark/crypto/webcrypto-digest.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { sync: ['createHash', 'subtle'], data: [10, 20, 50, 100], method: ['SHA-1', 'SHA-256', 'SHA-384', 'SHA-512'], - n: [1e3], + n: [1e5], }); const kMethods = {