Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply autofixes iteratively until code is stabilized #875

Merged
merged 2 commits into from
Nov 22, 2022

Conversation

charliermarsh
Copy link
Member

Resolves #868, #866, #660.

@JonathanPlasse
Copy link
Contributor

How does it impact performance?

@charliermarsh
Copy link
Member Author

Seems pretty fast! Certainly within the margin of error, possibly even faster because of some other changes in the PR?

The nice thing is that we only need to re-lint files that changed, and we don't actually have to write and read from disk every time we re-lint -- we can just keep the changed contents in memory.

Before:

∴ hyperfine --warmup 10 --runs 25 -i --cleanup "git reset --hard HEAD" "../../../target/release/ruff --no-cache --fix ."
Benchmark 1: ../../../target/release/ruff --no-cache --fix .
  Time (mean ± σ):     308.2 ms ±   7.5 ms    [User: 2475.2 ms, System: 92.0 ms]
  Range (min … max):   302.5 ms … 342.4 ms    25 runs

After:

∴ hyperfine --warmup 10 --runs 25 -i --cleanup "git reset --hard HEAD" "../../../target/release/ruff --no-cache --fix ."
Benchmark 1: ../../../target/release/ruff --no-cache --fix .
  Time (mean ± σ):     304.1 ms ±   2.7 ms    [User: 2449.3 ms, System: 87.2 ms]
  Range (min … max):   300.0 ms … 309.7 ms    25 runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade autofix to fix-until-stable
2 participants