Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/merlin/deps.ts>bench.bench

Testing and Benchmarking framework for deno 🧙‍♂️
Latest
class bench.bench
extends Error
Re-export
import { bench } from "https://deno.land/x/merlin@v1.0.7/deps.ts";
const { bench } = bench;

Constructors

new
BenchmarkRunError(msg: string, benchmarkName?: string)

Properties

optional
benchmarkName: string
interface bench.bench
Re-export
import { type bench } from "https://deno.land/x/merlin@v1.0.7/deps.ts";
const { bench } = bench;

Provides methods for starting and stopping a benchmark clock.

Properties

start: () => void
stop: () => void

Call Signatures

(b: BenchmarkTimer): void | Promise<void>

Properties

name: string

Properties

name: string
optional
runs: number

Defines how many times the provided func should be benchmarked in succession

Properties

optional
only: RegExp

Only benchmarks which name match this regexp will be run

optional
skip: RegExp

Benchmarks which name match this regexp will be skipped

optional
silent: boolean

Setting it to true prevents default benchmarking progress logs to the commandline

Properties

optional
only: RegExp

Only benchmarks which name match this regexp will be removed

optional
skip: RegExp

Benchmarks which name match this regexp will be kept

Properties

name: string

The name of the benchmark

totalMs: number

The total time it took to run a given bechmark

runsCount: number

Times the benchmark was run in succession.

measuredRunsAvgMs: number

The average time of running the benchmark in milliseconds.

measuredRunsMs: number[]

The individual measurements in milliseconds it took to run the benchmark.

Properties

filtered: number

How many benchmark were ignored by the provided only and skip

results: BenchmarkResult[]

The individual results for each benchmark that was run

Properties

optional
queued: Array<{ name: string; runsCount: number; }>

List of the queued benchmarks to run with their name and their run count

optional
running: { name: string; runsCount: number; measuredRunsMs: number[]; }

The currently running benchmark with its name, run count and the already finished measurements in milliseconds

optional
state: ProgressState

Indicates in which state benchmarking currently is

function bench.bench
Re-export
import { bench } from "https://deno.land/x/merlin@v1.0.7/deps.ts";
const { bench } = bench;

Registers a benchmark as a candidate for the runBenchmarks executor.

enum bench.bench
Re-export
import { bench } from "https://deno.land/x/merlin@v1.0.7/deps.ts";
const { bench } = bench;

Defines the states BenchmarkRunProgress can be in

Members

BenchmarkingEnd = "benchmarking_end"
BenchmarkingStart = "benchmarking_start"
BenchPartialResult = "bench_partial_result"
BenchResult = "bench_result"
BenchStart = "bench_start"