Severe performance regression with many LSP error spans
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
- Install vale and set up
~/.config/vale/.vale.inior on macOS~/Library/Application Support/vale/.vale.ini:
MinAlertLevel = suggestion
Packages = RedHat, Readability, proselint
[*]
BasedOnStyles = Vale, RedHat, Readability, proselint
- run
vale syncto fetch the configured rulesets - install the vale extension in zed (and asciidoc for good measure, too)
- grab a snapshot or clone https://github.com/KhronosGroup/OpenCL-Docs and open
extensions/cl_intel_unified_shared_memory.asciidoc - watch zed freeze completely for 15 seconds
Environment
Ubuntu 24.04 GNOME Wayland Zed 0.151.0-dev
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
No response
In addition to freezing while opening the file, selecting text with the mouse is very sluggish in this situation.
Here's another example:
- Clone CDDA
git clone --depth 1 https://github.com/CleverRaven/Cataclysm-DDA.git
3. Replace .clang-tidy with this
Checks: "\
*,\
-abseil*,\
-altera*,\
-bugprone-easily-swappable-parameters,\
-cert-err58-cpp,\
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,\
-cppcoreguidelines-avoid-magic-numbers,\
-fuchsia*,\
-google-build-using-namespace,\
-google-default-arguments,\
-google-readability-todo,\
-hicpp-no-array-decay,\
-hicpp-uppercase-literal-suffix,\
-llvm-header-guard,\
-llvmlibc*,\
-modernize-use-trailing-return-type,\
-modernize-use-nodiscard,\
-readability-identifier-length,\
-readability-magic-numbers,\
"
basically turn on most things
- Generate a compilation database
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S . -B build && ln -s build/compile_commands.json . - Open
src/item.cppin zed
That way you get ~600 annotations from the lsp and zed is extremely slow - it takes several seconds just to move the cursor.
The gist of this issue is that we query diagnostic info on a frame-by-frame basis, regardless of whether we'll actually use it. We should allow language::Chunks type to omit fetching diagnostic info, just like it can omit doing syntax highlighting.
This is a regression from https://github.com/zed-industries/zed/pull/15646; we used to not fetch diagnostic info for language-unaware iteration, but since that PR it is fetched unconditionally. The PR is on its way.