From f5582dd4969a7832094cf14b65ec4e34c78c28d9 Mon Sep 17 00:00:00 2001 From: Ophelia Goldstein <159258143+opheliagoldstein@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:35:18 +0300 Subject: [PATCH] chore: improve bench tests utils jsdoc readability (#4501) Co-authored-by: Alexandr --- backend/tests/bench/utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/tests/bench/utils.js b/backend/tests/bench/utils.js index a94b258b..f4c8afb4 100644 --- a/backend/tests/bench/utils.js +++ b/backend/tests/bench/utils.js @@ -3,6 +3,7 @@ const DEFAULT_WARMUPS = 50; /** * Formats a duration in nanoseconds to a compact human-readable string. + * * @param {bigint} ns Duration in nanoseconds. * @returns {string} Formatted time string. */ @@ -21,6 +22,7 @@ const formatTime = (ns) => { /** * Measures synchronous or async function execution time. + * * @param {Function} fn Function to measure. * @returns {Promise} elapsed nanoseconds */ @@ -36,6 +38,7 @@ const measurePerformance = async (fn) => { /** * Computes basic & extended statistics. + * * @param {bigint[]} samples Array of samples in nanoseconds. * @returns {object} Stats */ @@ -75,6 +78,7 @@ const computeStats = (samples) => { /** * Benchmark a function. + * * @param {string} fnName Name of the function (for logging). * @param {Function} fn Function to benchmark. * @param {object} [opts] Options.