zed
zed copied to clipboard
Markdown: stable 70%+ CPU usage on typing
Describe the bug / provide steps to reproduce it
Constantly high CPU usage on Markdown documents, the preview is off. Tested also on .js files and got 35%, which is quite high.
Environment
Zed preview 0.160.6 on Linux & Wayland
Could it be an LSP?
Tested with "enable_language_server": "false" - no difference.
Same problem here. Switching the file type to "plain text": no change, markdown seems not to be specific to the problem. Disabling language server: no change. CPU usage seems related to window size. CPU usage goes down when window is smaller.
Is this something you're still seeing in current versions of Zed?
Yes.
Still actual on v0.188.6.
Can you paste your zed: copy system specs into clipboard into the original description. Curious what your video device is.
Done.
I think this may be related to your video device or driver revision. The Intel(R) HD Graphics 5500 is ~10 years old (Broadwell, first launched Fall 2014) and has to share your 16GB of system memory.
CPU usage goes down when window is smaller.
This sounds like it is having trouble redrawing the editor each frame, and it can't really keep up drawing Zed when fullscreen. Almost sounds like you're getting LLVMpipe level of performance (quite bad).
Based on a cursory search, there are other folks who are appear to be using this or similar GPUs, but I don't have any great recommendations -- perhaps try X11 instead of Wayland? See if an older release of Mesa works better? We'd love to support older hardware (similar vintage hardware on the Mac the Metal renderer is usable) but given that your card predates Vulkan by a couple years, it's not that surprising that the Vulkan driver on Linux does not perform as well as Metal on MacOS or likely Direct3D on Windows.
Sorry I don't have a better answer.
@notpeter The workaround is systemd-run --scope -p CPUQuota="20%" --user zed, I got very small UI lag. If this issue is related only to Vulkan performance then how it's even possible? Also tested 12% and the lag was bigger, the app was barely usable.
I think the problem is hidden deep within type processing, autocomplete etc.
All type processing/autocomplete is handled by LSPs. You should see subprocesses for each of these -- so it should be easy to tell whether it's Zed using the CPU or one of the LSPs.