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

Enable caching for --fix and --diff #8315

Closed
charliermarsh opened this issue Oct 28, 2023 · 1 comment · Fixed by #8316
Closed

Enable caching for --fix and --diff #8315

charliermarsh opened this issue Oct 28, 2023 · 1 comment · Fixed by #8316
Assignees
Labels
performance Potential performance improvement

Comments

@charliermarsh
Copy link
Member

Right now, we completely disable caching when you run with --fix and --diff, the reason being that the caching exists at a higher level (we save Diagnostics), and those commands rely on side-effects that happen during the creation of Diagnostics.

It's highly inefficient to avoid caching there!

@charliermarsh
Copy link
Member Author

I think we can at least read from the cache for files with no errors, which will give us high lift without any refactoring. I'll do that...

@charliermarsh charliermarsh self-assigned this Oct 28, 2023
@charliermarsh charliermarsh added the performance Potential performance improvement label Oct 28, 2023
charliermarsh added a commit that referenced this issue Oct 29, 2023
## Summary

If a file has no diagnostics, then we can read and write that
information from and to the cache, even if the fix mode is `--fix` or
`--diff`. (Typically, we can't read or write such results from or to the
cache, because `--fix` and `--diff` have side effects that take place
during diagnostic analysis (writing to disk or outputting the diff).)
This greatly improves performance when running `--fix` on a codebase in
the common case (few diagnostics).

Closes #8311.
Closes #8315.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Potential performance improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant