biome/benchmark
renovate[bot] be15544f2f
Some checks failed
Benchmarks Configuration / Bench (push) Waiting to run
Benchmarks JS / Bench (push) Waiting to run
CI on main / Lint Rust Files (push) Waiting to run
CI on main / Check Dependencies (push) Waiting to run
CI on main / Test (push) Waiting to run
CI on main / Format Rust Files (push) Waiting to run
CI on main / Test262 Coverage (push) Waiting to run
Release / Release (push) Waiting to run
Release / version (push) Blocked by required conditions
Release / Package darwin-arm64 (push) Blocked by required conditions
Release / Package darwin-x64 (push) Blocked by required conditions
Release / Package linux-arm64-musl (push) Blocked by required conditions
Release / Package linux-x64-musl (push) Blocked by required conditions
Release / Package win32-arm64 (push) Blocked by required conditions
Release / Package win32-x64 (push) Blocked by required conditions
Release / Package linux-arm64 (push) Blocked by required conditions
Release / Package linux-x64 (push) Blocked by required conditions
Release / Build WASM (push) Blocked by required conditions
Release / Package JavaScript APIs (push) Blocked by required conditions
Release / Publish CLI (push) Blocked by required conditions
Release / Publish JS API (push) Blocked by required conditions
Repository dispatch on main / Build @biomejs/wasm-web (push) Waiting to run
Repository dispatch on main / Repository dispatch (push) Blocked by required conditions
Benchmarks JSON / Bench (push) Has been cancelled
Benchmarks CSS / Bench (push) Has been cancelled
Benchmarks GraphQL / Bench (push) Has been cancelled
Benchmarks Tailwind / Bench (push) Has been cancelled
Benchmarks Manifests / Bench (push) Has been cancelled
Benchmarks Module Graph / Bench (push) Has been cancelled
chore(deps): update typescript-eslint monorepo to v8.46.3 (#8057)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-10 15:41:06 +09:00
..
.prettierignore fix(bench): typo in .prettierignore (#4134) 2024-09-30 08:37:23 +01:00
.prettierrc.json refactor: update bench (#3739) 2024-08-29 17:44:56 +02:00
bench.js fix: resolve settings based on path (#6175) 2025-05-30 12:09:24 +01:00
biome.json fix: resolve settings based on path (#6175) 2025-05-30 12:09:24 +01:00
dprint.json fix: resolve settings based on path (#6175) 2025-05-30 12:09:24 +01:00
eslint.config.js fix: resolve settings based on path (#6175) 2025-05-30 12:09:24 +01:00
package.json chore(deps): update typescript-eslint monorepo to v8.46.3 (#8057) 2025-11-10 15:41:06 +09:00
README.md refactor: update bench (#3739) 2024-08-29 17:44:56 +02:00
ts-biome.json refactor(lint): move noArguments and noCommaOperator to complexity (#6090) 2025-05-19 21:26:02 +02:00
ts-eslint.config.js fix: resolve settings based on path (#6175) 2025-05-30 12:09:24 +01:00
tsconfig.json fix: resolve settings based on path (#6175) 2025-05-30 12:09:24 +01:00

Benchmarks

Running in Docker

Run in the root directory, not ./benchmark

  1. docker build --rm -f Dockerfile.benchmark . --progress plain

Running locally

  1. Install hyperfine: cargo install hyperfine
  2. Install node modules: pnpm i
  3. Run one of benchmark suites:
    • the benchmarks of the formatters: node bench.js formatter
    • the benchmarks of the linter: node bench.js linter

Results

Setup: MacBook Pro (13-inch, M1, 2020)

Formatting

  • Biome's ~25 times faster than Prettier
  • Biome's ~20 times faster than parallel-prettier
  • Biome's ~20 times faster than xargs -P1
  • Biome's 1.5 to 2 times faster than dprint
  • Biome single-threaded is ~7 times faster than Prettier.

The speed-ups for the multithreaded benchmarks can vary significantly depending on the setup. For example, Biome is 100 times faster than Prettier on an M1 Max with 10 cores.

Linting

  • Biome's ~15x times faster than ESLint (without any plugins)

  • Biome single-threaded is ~4 times faster than ESLint.

  • Biome's linter is fast, but there is room for improvements

  • Biome's linter spends significant time building the semantic model, the control flow graph, and matching queries. I'm convinced there's room for improvement (3565, 3569).

  • Computing the diff for code fixes is expensive. Biome can spend up to 3s computing diffs (not measured by these benchmarks, see explanations below)

Notes

We've been careful to create fair benchmarks. This section explains some of the decisions behind the benchmark setup and how these decisions affect the results. Please let us know if you have ideas on how to make the benchmarks fairer or if there's a mistake with our setup.

Formatting

  • Compares the wall time of Biome, Prettier, and dprint to format all files in a project where all files are correctly formatted. To ensure that files are correctly formatted we run twice a toll (warm-up) before benchmarking it.
  • dprint and Prettier support incremental formatting to only format changed files, whereas Biome does not. This benchmark does not measure incremental formatting as it measures cold formatting time. You may see significant speedups on subsequent formatting runs when enabling incremental formatting.
  • The benchmark limits Prettier to only format JavaScript and TypeScript files because Biome doesn't support other file types.
  • Biome only prints a summary with the number of formatted files. The prettier benchmark uses --log-level=error for a fairer benchmark so that Prettier doesn't print every filename.

Linting

  • Compares the wall time of Biome and ESLint to check all files in a project.
  • Only enables rules that both Biome and ESLint support.
  • The comparison includes ESLint without plugin and ESLint with the TypeScript ESLint plugin. To have a fair comparison we don't enable any rules that require type information because this is known to be very slow and Biome has not such capabilities yet.
  • Biome prints rich diffs for each lint diagnostic, whereas ESLint only shows the name and description of the lint rule. That's why the benchmark uses --max-diagnostics=0 when running Biome because Biome then only counts diagnostics without generating the diffs. Overall, this results in a more accurate comparison but has the downside that Biome only prints the diagnostic count, whereas ESLint prints a line for each lint error.

  1. Run time find lib/ examples declarations benchmark -name '*.js' -print0 | xargs -P8 -0 -n 200 npx prettier --write --loglevel=error in the target/webpack directory. I manually tinkered with the -n parameter to get the fastest run. ↩︎