new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Vitest · Guide · all subjects

benchmarking/workspaces

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

perProject option for comparing across multiple projects

Pass perProject: true in bench options to compare how the same benchmark performs across all projects in a workspace (e.g., different browsers or runtimes). Vitest prints the result inline for the current project and collects per-project results into a single comparison table at the end of the test run.

Example of perProject: true benchmark

import { test } from 'vitest' test('simple example', async ({ bench }) => { await bench('1 + 1', { perProject: true }, () => { 1 + 1 }).run() })

Mix perProject and regular benchmarks in bench.compare()

You can mix perProject benchmarks with regular ones inside bench.compare(). The regular benchmark appears in the normal inline comparison table per project, while perProject benchmarks are additionally collected into the cross-project comparison table at the end.

Per-project benchmark artifacts with ${projectName} placeholder

In a multi-project workspace, share one benchmark file across projects by including ${projectName} in the path. The placeholder is substituted with the current project name at write time.

Example of per-project benchmark artifacts

test('cross-project baseline', async ({ bench }) => { await bench( 'parse', { perProject: true, writeResult: './benchmarks/parse.${projectName}.json' }, () => parse(largeInput), ).run() })

Give your agent this brain