ccls icon indicating copy to clipboard operation
ccls copied to clipboard

Using 100% of CPU whenever I type

Open JulioHC00 opened this issue 4 years ago • 1 comments

I've tried solving this problem myself looking at previous issues and looking into everything I could find but I really have no experience and I have failed to solve it. I hope opening an issue here is the right thing to do.

Observed behavior

ccls with coc.nvim, configuration file includes

"languageserver": {
    "ccls": {
      "command": "ccls",
      "filetypes": ["c", "cpp", "objc", "objcpp"],
      "rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
      "initializationOptions": {
         "cache": {
           "directory": "/tmp/ccls"
         }
       }
    }
  }

node version: 14.18.3

Running on a very small project (learning C++) with this .ccls file

clang++

%h %cpp -std=c++17

Whenever I start writing into the files the CPU usage jumps to 100% from a ccls process. When I stop typing after a while it goes down again. Same happens if I start writing again.

Here's a GIF showing what happens

simplescreenrecorder-2022-01-14_17 42 45

Expected behavior

Not 100% usage of CPU with everything I type.

System information

  • ccls version (git describe --tags --long): 12.0.0-3ubuntu~21.04.2
  • clang version: Ubuntu clang version 12.0.0-3ubuntu1~21.04.2
  • OS: Ubuntu 21.04
  • Editor: nvim 0.6.1
  • Language client (and version): coc.nvim 0.0.80-8874b

EDIT: I have completely formatted my PC in case it was an issue somewhere in my installations, but the same is happening.

JulioHC00 avatar Jan 14 '22 17:01 JulioHC00

one cause maybe neovim watchfile implementation sucks, I mean nvim itself, not ccls high cpu usage

ioperations avatar Sep 25 '23 16:09 ioperations