fix(bench): lower bench time budget when n is specified (#28454)

Closes #28430
This commit is contained in:
David Sherret 2025-03-10 16:17:19 -04:00 committed by GitHub
parent 9ea4f82643
commit ff28ecd91a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -1242,9 +1242,16 @@ declare namespace Deno {
/** If at least one bench has `only` set to true, only run benches that have
* `only` set to `true` and fail the bench suite. */
only?: boolean;
/** Number of iterations to perform. */
/** Number of iterations to perform.
* @remarks When the benchmark is very fast, this will only be used as a
* suggestion in order to get a more accurate measurement.
*/
n?: number;
/** Number of warmups to do before running the benchmark. */
/** Number of warmups to do before running the benchmark.
* @remarks A warmup will always be performed even if this is `0` in order to
* determine the speed of the benchmark in order to improve the measurement. When
* the benchmark is very fast, this will be used as a suggestion.
*/
warmup?: number;
/** Ensure the bench case does not prematurely cause the process to exit,
* for example via a call to {@linkcode Deno.exit}.