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

feat/bug: slow check times -> perhaps add dependency aware version of check.workspace=false #17255

Open
rbtcollins opened this issue May 18, 2024 · 0 comments
Labels
A-diagnostics diagnostics / error reporting A-perf performance issues C-feature Category: feature request

Comments

@rbtcollins
Copy link

rbtcollins commented May 18, 2024

Today, in our company workspace, when I save a file in a binary leaf crate - e.g. an alteration to main.rs, it takes:

  • 40 seconds for rust-analyzer to run clippy on all the members
  • or 40 seconds for it to run check on all the members
  • or 2 seconds to run clippy on the member
  • or 2 seconds to run check on the member

Depending on what check-on-save command I am using and the value of check.workspace.

With just cargo at the command line,

  • 1 second to run clippy --workspace
  • or 1 second to run check --workspace

Changing a mid-layer crate, and clippy --workspace takes ~ 4 seconds or so.

Which is fine, but the times from RA itself are not.

With check.workspace = True, every crate in a workspace - we're at 90 - has the check command run when a file is saved.
This takes some time but when a public interface is changed and causes another crate to fail, that is picked up immediately.

With check.workspace = False, only the package the file belongs to is rechecked, but changes that alter public interfaces go unnoticed until those other crates are saved.

What I would love is a version that runs check on the closure of the reverse dependencies of the package the saved file was in.

For example, imagine that we have a proc macro crate, a library that works in concert with that proc macro crate - including re-exporting it, and a binary:

binary

  • library
    • proc-macro

saving a file in binary would check binary
saving a file in library would check binary and library
saving a file in proc-macro would check binary and library and proc-macro

Alternatively, if RA would literally run 'clippy --workspace' or 'check --workspace' that would also solve things.

@rbtcollins rbtcollins added the C-feature Category: feature request label May 18, 2024
@rbtcollins rbtcollins changed the title dependency aware version of check.workspace=false feat: dependency aware version of check.workspace=false May 18, 2024
@rbtcollins rbtcollins changed the title feat: dependency aware version of check.workspace=false feat/bug: slow check times -> perhaps add dependency aware version of check.workspace=false May 18, 2024
@Veykril Veykril added A-perf performance issues A-diagnostics diagnostics / error reporting labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting A-perf performance issues C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants