vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 400 forks source link

Vue official works slow #4580

Closed Ca-tt closed 4 months ago

Ca-tt commented 4 months ago

Type: Bug

Vue - Oficcial makes my pc work really hard and ruin my developer experience even on small VueJS projects including few libs like naive-ui and... well, that's all

I tried to disable TS at all, but it doesn't help

Extension version: 2.0.26 VS Code version: Code 1.91.1 (f1e16e1e6214d7c44d078b1f0607b2388f29d729, 2024-07-09T22:06:49.809Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz (4 x 2395)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|7.87GB (2.61GB free)| |Process Argv|--crash-reporter-id 69ec8a32-062b-4f9c-8429-dbcff0063c5f| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 vscaac:30438847 c4g48928:30535728 azure-dev_surveyone:30548225 vscrp:30673768 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 chatpanelc:31048052 dsvsc021:30996838 jg8ic977:31013176 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 legacy_priority:31094926 ```
Ca-tt commented 4 months ago

Tried to enable hybrid mode and and disabled vue > code lens. Improved performance a lot

RayGuo-ergou commented 4 months ago

Can you check the memory&cpu usage of vue-language-server?

And do you have the same performance issue with other language like c or go?

To me it's your PC's limitation as 8gb of memory will struggle with only VScode + a web browser.

RayGuo-ergou commented 4 months ago

Tried to enable hybrid mode and and disabled vue > code lens. Improved performance a lot

Btw hybrid mode off + vscode typescript feature on means you have 2 typescript language server running at same time. ( or just crash, I am not very sure as I don't use vscode)

Ca-tt commented 4 months ago

@RayGuo-ergou I don't have a similar struggle with Python, for example.

Yep, I enabled hybrid mode and VS Code now running way more faster. Suggestions appear almost instantly.

Can the issue appear from Vue > Code Lens?

Or is a hybrid mode configuration so essential?

RayGuo-ergou commented 4 months ago

Yep, I enabled hybrid mode and VS Code now running way more faster. Suggestions appear almost instantly.

Yeah I think it's running slow due to two typescript server running at the same time.

A bit of context:

Hybrid mode on: vue extension will only handle "vue part" e.g. content with in <template>, a typescript plugin will pass to vscode typescript language feature/server.

Hybrid mode off: vue extension will run a typescript server by it self to handle everything inside a vue file e.g. both <template> and <script>

Thus, with hybrid mode off + typescript feature enabled, it likely takes a lot of your memory ( from my observation when communicate with language servers e.g. auto completion, typescript server normally take 10 times ram compares to vue language server)

Can the issue appear from Vue > Code Lens?

Not sure tho, you can try to turn this on and off to see how it goes :)

Ca-tt commented 4 months ago

@RayGuo-ergou Thanks for explanation. I'm happy now my VS Code with my lovely Vue projects running really fast :)