vivekmalneedi / veridian

A SystemVerilog Language Server
MIT License
130 stars 15 forks source link

100% CPU utilization #190

Open jagjordi opened 4 months ago

jagjordi commented 4 months ago

I am getting 100% CPU utilization whenever I open a SV file image I am using NeoVim and LSP config to enable Veridian. In the LSP logs I don't see anything abnormal:

[ERROR][2024-05-21 15:46:33] .../vim/lsp/rpc.lua:734    "rpc"   "/sbin/veridian"    "stderr"    "INFO [veridian] starting veridian...\nINFO [veridian::server] found config: veridian.yml\nINFO [veridian::server] reading config file\nINFO [veridian::server] enabled linting with slang\nINFO [veridian::server] enabled linting with verilator\nINFO [veridian::server] enabled formatting with verible-verilog-format\n"

Can you give some pointers to trace down this issue?

jagjordi commented 4 months ago

It turned out I had a DesignWare directory in my path and I guess the parser got overloaded trying to parse all the modules. I moved it somewhere else and it works now. Maybe a nice addition would be to have a exclude pattern or a similar type of mechanism

vivekmalneedi commented 4 months ago

That's funny, the server design there is not great and it tries to start a thread to run the parser for every file it can find. It should be using a threadpool or just be hooked into the existing async runtime. An exclude option is a good idea. Though I guess another workaround would be to turn off auto_search_workdir.