-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
high CPU usage when enable vetur extension #216
Comments
Can you show me your file explorer view so I can take a look at your folder structure? |
I seem to have a similar issue on some of my projects. When vetur is enabled and vue file is opened/focused the CPU usages goes up to 30-45%, it drops to <1% when vetur is disabled. I've tried to narrow down the issue, no luck so far. It doesn't seem to occur on latest vue-cli projects with default settings. It does happen on 2 of my more complex solutions where the repo has 2-3 vue projects. I have these config files in the project roots: |
I have a little large project, some files are I think the problem is related to vue language server crash. Because the CPU usage will continue very high before vue language server crash. Every time the Code console said vue language server crashed, the CPU usage will be low. then the vue language server restarted.
|
When you have a project that has multiple sub project this seems to happen. Is it that you are having the trouble on this kind of repo?
If so, what's your tsconfig/jsconfig/package.json like if you do have them for your sub-project? |
@treri Can you try putting a This usually happens if some other large files are included by mistake. {
"include": [
"./src/**/*"
]
} |
@octref Great! The CPU usage will be normal IF I have a jsconfig.json {
"include": [
"./static/page/**/*"
]
} Every time I open a vue file, the CPU usage will be 60% ~ 100% more or less, and some later it will back normal, it will not always be very high 😁. The result was acceptable for me. thanks |
@octref Setting a jsconfig.json in root to only include the folders that have the Vue projects seems to be mitigating the issue. Setting them in the subproject folder doesn't have this effect. I don't have tsconfig files. The project where I can consistently reproduce this issue has this structure:
This project has a long history :) |
Um, where is your vue project?
|
@octref it's in
It does seem to fix the issue, as @treri said, there is only an initial spike that goes away in about 2sec. I'll see if I can list the other js projects in includes or exclude the no-js projects. The docs says that I appreciate you help, cheers! |
Yeah this is less than ideal. Currently the TypeScript language server takes in everything in your workspace unless you specify a jsconfig/tsconfig. I'm looking into only include *.vue files and the files that they import. |
I'm having the same issue, but adding a jsconfig.json to only point at my Vue files does not solve the issue. It also doesn't happen immediately, but anywhere between 5 mins and a few hours after I start working. I think it's related to the Vue server or something like that. |
Same issue here, happening right after opening a vue-based project. Wasn't the case some weeks ago, so probably was caused by some version bump.
|
@gbezyuk |
@octref thanx, but may I suggest an idea of excluding |
|
This issue is still happening even when excluding "node_modules" or including src directory of a very small project |
@eronaeon Can you try to provide a repro case? |
If the jsconfig/tsconfig approach does not work for you, and you are on latest version, open a new issue with repro steps & a sample project. |
Just want to add that this empty array fixes the bug for me on Linux Mint (VSCode 1.23.0, Vetur 0.11.7)
|
Code Version: 1.12.2
You see, I have disabled all my extensions.
when I enable vetur, the CPU usage is 100%+, when I disabled vetur again, the CPU will back to normal.
The text was updated successfully, but these errors were encountered: