zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.69k stars 2.92k forks source link

Reduce time from type to autocompletion menu open #12750

Open JosephTLyons opened 4 months ago

JosephTLyons commented 4 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Work was done to improve the speed at which our completions filtered into the autocompletion menu here - we are now noticeably faster after the menu appears, but the speed in which the menu shows seems to be slower than other editors with the same project.

Using @osiewicz's project that reproduces some of the perf issues in TS, we can see we are slower to pop open the menu when compared to VS Code:

Zed:

https://github.com/zed-industries/zed/assets/19867440/448fb4f1-499a-4238-bece-e30d8362c627

VS Code:

https://github.com/zed-industries/zed/assets/19867440/cd13884f-ac48-42b7-9ffc-ea0b779a2f38

Peter mentioned Helix being faster as well

Environment

Zed: v0.140.0 (Zed Nightly 4fd698a093cb4be8f29d258ed3988155aa175122) OS: macOS 14.4.0 Memory: 64 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

curiousercreative commented 4 months ago

Perhaps related, type definitions are also quite slow to show (on hover or click)

osiewicz commented 4 months ago

In https://github.com/zed-industries/zed/pull/12928 I've slashed the time needed for us to deserialize large LSP responses (500ms -> 200ms). I think we should be slightly better now.

JosiahParry commented 4 months ago

I'm running into this issue with Rust. It takes multiple seconds for it to be recognized using

Zed: v0.140.5 (Zed) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

Screen Recording 2024-06-22 at 13 44 34

Arsik0153 commented 8 hours ago

Same here. Typescript autocompletion feels lot slower than in VSCode. Issue still exists.

mocenigo commented 8 hours ago

Same here. Typescript autocompletion feels lot slower than in VSCode. Issue still exists.

I think VSCode also caches older autocompletions and can work asynchronously, updating the completion list as it goes. I think that show and starting to populate the menu while deserialising is the key, unless it is already being done.

I believe that the right contact for this issue is @osiewicz (love the Gyro Gearloose avatar!).

osiewicz commented 6 hours ago

Could you turn on tracing on the language server level to see whether it's just us being slow to process the completions?