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

neovim use this plugin will make a high cpu percentage #39

Open
hanleylee opened this issue Sep 6, 2021 · 13 comments
Open

neovim use this plugin will make a high cpu percentage #39

hanleylee opened this issue Sep 6, 2021 · 13 comments

Comments

@hanleylee
Copy link

Describe the bug
When I use this plugin on vim, it works very well, but when I use it on neovim(terminal), the cpu usage is too high and it will not return back to normal level percentage unless I quit neovim.

To Reproduce
Steps to reproduce the behavior:

  1. CocInstall coc-vimlsp
  2. enter any *.vim file

Expected behavior

normal cpu percentage, or let me know how to debug and fix it.

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS

following is my configuration in ~/.nvim/coc-setting.json

    // coc-vimlsp
    "vimlsp.trace.server": "off",
    "vimlsp.debug": false,
    "vimlsp.diagnostic.enable": true,
    "vimlsp.suggest.fromVimruntime": true,
    "vimlsp.suggest.fromRuntimepath": true,
    "vimlsp.indexes.gap": 100,
    "vimlsp.indexes.count": 1,
    "vimlsp.indexes.runtimepath": true,
    "vimlsp.indexes.projectRootPatterns": [
        ".git",
        "autoload",
        "plugin"
    ],
    "vimlsp.filetypes": [
        "vim"
    ],
@iamcco
Copy link
Owner

iamcco commented Sep 6, 2021

It will not effect neovim by this extension. The service run in separate program process. Please test with minimum vimrc

@hanleylee
Copy link
Author

image

I make a screenshot for Activity Monitor of MacOS, it indicate the high cpu percentage is caused by node.

After 10 minutes, the cpu percentage will disappear, it return back to normal. Why does this operation take so long time?

If I uninstall coc-vimlsp, there will no high cpu usage, so I think maybe coc-vimlsp have some dead loop? I don't know how to debug it, I add "vimlsp.debug": true, in my coc-setting.json, but there is no any output for this issue.

@iamcco
Copy link
Owner

iamcco commented Sep 7, 2021

set vimlsp.indexes.count to 1 or vimlsp.indexes.gap to 500 or greater and test to see if it happend.

@hanleylee
Copy link
Author

image

still high. I'm curious why this doesn't happen when I'm using vim, this issue only for neovim.

@iamcco
Copy link
Owner

iamcco commented Sep 7, 2021

set vimlsp.indexes.runtimepath to false and test?

@hanleylee
Copy link
Author

No help, still high cpu percentage. I even try to comment all config about coc-vimlsp, but it still same after I enter any *.vim file

@iamcco
Copy link
Owner

iamcco commented Sep 7, 2021

What's your nodejs and neovim version? M1 MacOS ? I don't have any idea about the problem. Also check out the LSP output channel to see if any error message?

And can you check which nodejs process hanging ?
image

@hanleylee
Copy link
Author

nvim version: 0.5.0(installed by homebrew)
os: MacOS 11.5.2
node: 16.8.0
cpu: M1

$ ps -ae | grep coc-vim
59176 ??         0:00.17 /opt/homebrew/Cellar/node/16.8.0/bin/node /Users/hanley/.config/coc/extensions/node_modules/coc-vimlsp/out/server --node-ipc --clientProcessId=59121
59177 ??         0:12.57 /opt/homebrew/Cellar/node/16.8.0/bin/node /Users/hanley/.config/coc/extensions/node_modules/coc-vimlsp/out/scan.js --node-ipc
59180 ttys000    0:00.00 grep coc-vim

$ nvim --version
NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210702-97973-1wtbty6/neovim-0.5.0/build/config -I/tmp/neovim-20210702-97973-1wtbty6/neovim-0.5.0/src -I/opt/homebrew/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/gettext/include -I/tmp/neovim-20210702-97973-1wtbty6/neovim-0.5.0/build/src/nvim/auto -I/tmp/neovim-20210702-97973-1wtbty6/neovim-0.5.0/build/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.5.0/share/nvim"

Run :checkhealth for more info


$ node --version
v16.8.0

@iamcco
Copy link
Owner

iamcco commented Sep 7, 2021

Please update to latest version and test again. Seems something wrong with M1 MacOS and nodejs. iamcco/vim-language-server#63

@hanleylee
Copy link
Author

After I update coc plugin by command :CocUpdate, and restart my mac, the cpu percentage is still high if I enter any *.vim file 😂.

What I curious about is why only neovim's coc-vimlsp have problem(coc-vimlsp on vim works very well), actually my vim and neovim share the same configuration

image

@iamcco
Copy link
Owner

iamcco commented Sep 8, 2021

I have no idea. Maybe check out the LSP output channel to see if any info?

@hanleylee
Copy link
Author

Please tell me the step to check the info of the LSP output channel

@iamcco
Copy link
Owner

iamcco commented Sep 8, 2021

set "vimlsp.trace.server": "verbose", reproduce the problem and CocCommand workspace.showOutput then select vimlsp

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

No branches or pull requests

2 participants