mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
7ae5ee699f
Lately, I've been finding Rust-analyzer unusably slow when editing large files (like `editor_tests.rs`, or `integration_tests.rs`). When I profile the Rust-analyzer process, I see that it sometimes saturates up to 10 cores processing a queue of code actions requests. Additionally, sometimes when collaborating on large files like these, we see long delays in propagating buffer operations. I'm still not sure why this is happening, but whenever I look at the server logs in Datadog, I see that there are remote `CodeActions` and `DocumentHighlights` messages being processed that take upwards of 30 seconds. I think what may be happening is that many such requests are resolving at once, and the responses are taking up too much of the host's bandwidth. I think that both of these problems are caused by us sending way too many code action and document highlight requests to rust-analyzer. This PR adds a simple debounce between changing selections and making these requests. From my local testing, this debounce makes Rust-analyzer *much* more responsive when moving the cursor around a large file like `editor_tests.rs`. |
||
---|---|---|
.. | ||
resources | ||
src | ||
build.rs | ||
Cargo.toml | ||
RELEASE_CHANNEL |