-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Optimise ALE for larger files with wild numbers of errors #4208
Comments
FYI @hsanson. I'll... sort this out... hopefully soon. |
Any further updates on this? Working on large files is practically impossible, I have to turn off the LSPs. This is how it looks on head ATM, no screen-keys, but I'm moving at all times, which you can't see because my vim just freezes because of the errors. Edit; I'd say, turning off inline error messages improves performance by like 20%. Not sure if there are other configurations I can use to speed things up? Like for example, I see absolutely 0 need for the constant This issue with errors in larger files isn't exclusive to Ale, I switched from COC to Ale, because CoC was also breaking in this file, it's 2k lines, and if you have an object, with a single structural error, it generates an error for literally each, valid (now invalid because of the outer structural error) item within said object. Perhaps an option to limit errors within an object and show the outermost error only, at first. Not sure how these types of things work, but happy to help. Screen.Recording.2024-03-13.at.9.04.05.mov |
I can confirm that the idea of restricting the number of diagnostics ( Additionally, since This would reduce the cost when the problem is the number of linters providing a large combined set of diagnostics. It would do less if one linter is on a rampage while the remaining linters emit a handful of diagnostics each. For that case, you want |
Problem
Introducing a syntax error early in a large file will cause many language servers and linters to spew out potentially hundreds of errors that are difficult for any editor to deal with. The problem is visible when profiling ALE.
Which points to this code in
engine.vim
.Solution
There's no one solution. Instead, there are many solutions, and we should do all of them at once to greatly improve ALE's efficiency.
sort
for problems from those linters.g:
andb:
scoped ALE setting with a low number that simply ignores all but N many problems from any source by default. (No point reporting 100 errors at a time, etc.)flake8
that simply report the first syntax error and throw all other errors away, as special cases.sort
algorithm, which could mean breaking the rule of "only Vim script" in this one circumstance, with a Vim script fallback. Perhaps Lua or Python sorting is a lot faster. (We would add anale#util#Sort
internal API function.)The text was updated successfully, but these errors were encountered: