mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00

## Summary I found that `cargo benchmark lexer` didn't work as expected: ```shell ❯ cargo benchmark lexer Finished bench [optimized] target(s) in 0.08s Running benches/formatter.rs (target/release/deps/formatter-4e1d9bf9d3ba529d) Running benches/linter.rs (target/release/deps/linter-e449086ddfd8ad8c) ``` Turns out that `cargo bench -p ruff_benchmark` is now recommended over `cargo benchmark`, so updating the docs to reflect that.
16 lines
451 B
Markdown
16 lines
451 B
Markdown
# Ruff Benchmarks
|
|
|
|
The `ruff_benchmark` crate benchmarks the linter and the formatter on individual files:
|
|
|
|
```shell
|
|
# Run once on the "baseline".
|
|
cargo bench -p ruff_benchmark -- --save-baseline=main
|
|
|
|
# Compare against the "baseline".
|
|
cargo bench -p ruff_benchmark -- --baseline=main
|
|
|
|
# Run the lexer benchmarks.
|
|
cargo bench -p ruff_benchmark lexer -- --baseline=main
|
|
```
|
|
|
|
See [CONTRIBUTING.md](../../CONTRIBUTING.md) on how to use these benchmarks.
|