@codspeed/tinybench-plugin
and tinybench
(if not already installed):
Bench
instance with CodSpeed support by using the
withCodSpeed
helper. This step is critical to enable CodSpeed on
your benchmarks.
fibonacci
function for 10 and 15.
.ts
file directly, we recommend using
esbuild-register
. It allows
running TypeScript & ESM files directly with Node.js.codspeed-node
repository.
There are multiple examples available, for CJS, ESM, JavaScript, and TypeScript.src
directory contains the source code of the project. Here we have two
files, fibonacci.ts
and foobarbaz.ts
.bench
directory contains the benchmarks for the project. There is a file
for each source file that defines benchmarks for it.bench/index.bench.ts
file is the entry point for the benchmarks. It
imports all the other benchmark files and runs them.Bench
as a parameter and
then adds some benchmarks to it. This will allow us to add benchmarks to the
same suite from multiple files.
with-typescript-cjs
in the codspeed-node
repository.main
branch and every
pull request: