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 nil diagnostics for multiple files #126

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

9999years
Copy link

Closes #124.

This is the naive approach, which does not attempt to read files or compute diagnostics in parallel (unless there's some salsa magic I don't understand happening under the hood).

I was expecting this to be pretty slow, but on a codebase with 234 Nix files comprising 14,000 LOC, nil diagnostics **/*.nix completes in 33ms. (Compare this to parallel --max-args 1 nil diagnostics ::: **/*.nix, which takes a full 4 seconds.)

If we try nil diagnostics **/*.nix in nixpkgs, we get:

exec: Failed to execute process 'nil': the total size of the argument list and exported variables (1.5MB) exceeds the OS limit of 1MB.

Which was to be expected. Using find to execute nil diagnostics with as many arguments as possible (find . -path '*.nix' -exec nil diagnostics {} +) completes in just 6.5 seconds! (That's to analyze 32,800 files containing 3 million LOC.)

The comparable command for one-invocation-per-file (find . -path '*.nix' | parallel --pipe --cat -L 1 --max-args 1 nil diagnostics {}) takes... well, it's still running.

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.

Diagnostics for multiple files
1 participant