Skip to content
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

Slow suggestions #502

Closed
Zenthae opened this issue Sep 17, 2021 · 33 comments
Closed

Slow suggestions #502

Zenthae opened this issue Sep 17, 2021 · 33 comments

Comments

@Zenthae
Copy link

Zenthae commented Sep 17, 2021

Using Volar, auto completion become unusable because it can takes seconds to display the suggestion, when, most of the time you already have finished typing. I've seen #455 but i don't know if it's linked, i tested with every extension disabled other than volar 0.27.21

@johnsoncodehk
Copy link
Member

Please try to provide repro case, see #507 (comment).

@Zenthae
Copy link
Author

Zenthae commented Sep 19, 2021

there is no need of repro case, i just tested with default volar-starter and it's behaving the same way, suggestion is slow to display/load (and no it's not the timeout config)

@johnsoncodehk
Copy link
Member

Have you try disable other extensions? And please also make sure volar.lowPowerMode is disabled.

Please provide your VSCode info by Help: About command, and profiling record: #413

@Zenthae
Copy link
Author

Zenthae commented Sep 19, 2021

i tested with every extension disabled other than volar 0.27.21

VSCode Info :

Version: 1.60.1 (system setup)
Commit: 83bd43bc519d15e50c4272c6cf5c1479df196a4d
Date: 2021-09-10T17:07:10.714Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

volar.lowPowerMode is set to false

little example of what i'm trying to say, and btw, the part before displaying Loading... is also about 0.5 sec long

p9b4k6kkNd

@johnsoncodehk
Copy link
Member

Can you compare the auto-complete speed of plain ts and SFC's <script> block with the same code to rule out that this is not a ts issue?

@Zenthae
Copy link
Author

Zenthae commented Sep 19, 2021

here is the chrome profile

Profile.zip

@Zenthae
Copy link
Author

Zenthae commented Sep 19, 2021

Can you compare the auto-complete speed of plain ts and SFC's <script> block with the same code to rule out that this is not a ts issue?

if i understood you right, here it is, a lot faster even if it's still a bit slow for my liking (but i should stop asking for the moon xD)

ie7huhgUZ0

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Sep 19, 2021

You need to compare it by same code with same auto-complete trigger offset, because inside setup(), auto-complete is much slower due to TS overhead.

👇 the tryGetThisTypeAt calculate only occur in defineComponent's setup() function.
image

@Zenthae
Copy link
Author

Zenthae commented Sep 19, 2021

like this ?
512G7oV0qd

@Zenthae
Copy link
Author

Zenthae commented Sep 19, 2021

maybe it'll be easier like this, here is my current repo https://github.com/Zenthae/seer/tree/v2
i invited you so you should be able to clone it to test

@johnsoncodehk
Copy link
Member

It seem typescript-language-features has additional completion cache logic, will try to implement, but it's not easy.

@moliyu
Copy link

moliyu commented Sep 24, 2021

i think this problem just only appear in windows

@CrystalWindSnake
Copy link

CrystalWindSnake commented Sep 24, 2021

I think it can be compared with vetur. Now the prompt speed of volar seriously affects the user experience. And I think volar is now much slower than before

@johnsoncodehk
Copy link
Member

I think it can be compared with vetur. Now the prompt speed of volar seriously affects the user experience. And I think volar is now much slower than before

Please try to downgrade volar and let me know which version occur the problem beginning.

@Zenthae
Copy link
Author

Zenthae commented Sep 24, 2021

slower than vanilla TS but still a lot better than before.

WGZBRcZorz

@arpadgabor
Copy link

@Zenthae what version did you switch to? I'm also having performance issues with Volar, albeit my i7-7500U is pretty old now so that might also slow it down.

@Zenthae
Copy link
Author

Zenthae commented Sep 24, 2021

for my latest gif i used the latest version available which is v0.27.24

@CrystalWindSnake
Copy link

I think it can be compared with vetur. Now the prompt speed of volar seriously affects the user experience. And I think volar is now much slower than before

Please try to downgrade volar and let me know which version occur the problem beginning.

I tried to use the old version v0.22.23 of volar, and use the import module statement in the setup script, which is significantly faster than the latest version of volar

The following is the information output of the 2 versions。
I only enter "im" and wait for the prompt "import from" statement

v0.22.23 of volar:

Received response 'textDocument/completion - (15)' in 1164ms.

v0.27.24 of volar:

Received response 'textDocument/completion - (9)' in 1796ms.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Sep 25, 2021

@CrystalWindSnake could you run debug mode to check is the problem occur begin in this commit 15e744f ?

Please also provide:

  • VSCode info by Help: About command
  • TS version if you are using workspace TS module

@CrystalWindSnake
Copy link

I think it can be compared with vetur. Now the prompt speed of volar seriously affects the user experience. And I think volar is now much slower than before

Please try to downgrade volar and let me know which version occur the problem beginning.

I tried to use the old version v0.22.23 of volar, and use the import module statement in the setup script, which is significantly faster than the latest version of volar

The following is the information output of the 2 versions。
I only enter "im" and wait for the prompt "import from" statement

v0.22.23 of volar:

Received response 'textDocument/completion - (15)' in 1164ms.

v0.27.24 of volar:

Received response 'textDocument/completion - (9)' in 1796ms.

I found that the new version of volar will repeatedly send completion messages.
When I enter "im", he will receive "Received response 'textDocument/completion" messages twice

@CrystalWindSnake
Copy link

@CrystalWindSnake could you run debug mode to check is the problem occur begin in this commit 15e744f ?

Please also provide:

  • VSCode info by Help: About command
  • TS version if you are using workspace TS module

VSCode info by Help: About

版本: 1.60.2 (user setup)
提交: 7f6ab5485bbc008386c4386d08766667e155244e
日期: 2021-09-22T12:00:31.514Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

TS version(This is the prompt version of volar in the lower right corner of the interface):

TS 4.4.3

I found that the new version of volar will repeatedly send completion messages.
When I enter "im", he will receive "Received response 'textDocument/completion" messages twice,and the old version is only sent once.
Is this the cause of the problem?

@johnsoncodehk
Copy link
Member

@CrystalWindSnake I think you received 2 responses because you get a incomplete completion result when you typed i. When you typed m, TS calculate the complete result.

0.27.5 has related changes, please let me know if it's effect to you.

@CrystalWindSnake
Copy link

@CrystalWindSnake I think you received 2 responses because you get a incomplete completion result when you typed i. When you typed m, TS calculate the complete result.

0.27.5 has related changes, please let me know if it's effect to you.

Thank you, hope volar will get better and better

@nlvedwin
Copy link

also in macos this problem occurs slow but vetur is faster

@johnsoncodehk
Copy link
Member

@nlvedwin can you provide repro case?

@shunichio

This comment has been minimized.

@zhoujingfu

This comment has been minimized.

@shunichio

This comment has been minimized.

@jahnli
Copy link

jahnli commented Nov 15, 2021

@johnsoncodehk 我在windows上,也遇到了同样的问题,应该如何解决

@johnsoncodehk
Copy link
Member

@chivesssss, @zhoujingfu see #455.

@jahnli please provide repro case otherwise I can't check.

@arsize
Copy link

arsize commented Nov 18, 2021

I think it can be compared with vetur. Now the prompt speed of volar seriously affects the user experience. And I think volar is now much slower than before

Please try to downgrade volar and let me know which version occur the problem beginning.

Maybe 0.29.0

@jahnli
Copy link

jahnli commented Nov 18, 2021

@johnsoncodehk I don't know how to reproduce. At present, Windows will be slow if it only installs a volar code prompt. After uninstallation, it will be restored to normal

@johnsoncodehk
Copy link
Member

Please track #808.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants