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

Extension causes high cpu load #19

Open
andreyagra opened this issue Dec 30, 2018 · 10 comments
Open

Extension causes high cpu load #19

andreyagra opened this issue Dec 30, 2018 · 10 comments

Comments

@andreyagra
Copy link

  • Issue Type: Performance
  • Extension Name: rails
  • Extension Version: 0.8.5
  • OS Version: Darwin x64 17.7.0
  • VSCode version: 1.30.1

⚠️ Make sure to attach this file from your home-directory: /Users/andreyagra/bung87.rails-unresponsive.cpuprofile.txt ⚠️

Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load

@bung87
Copy link
Owner

bung87 commented Dec 31, 2018

could you provide the unresponsive.cpuprofile.txt file?

@andreyagra
Copy link
Author

bung87.rails-unresponsive.cpuprofile.txt
bung87.rails-unresponsive.cpuprofile.txt

@bung87
Copy link
Owner

bung87 commented Jan 6, 2019

thank you! I can't confirm what cause this problem,the profiler log shows it gets stuck in loading js module,I have not face this problem on my rails project developing.

@pycckuu
Copy link

pycckuu commented Jan 8, 2019

I do have the same problem. Could it be caused by solargraph?

@bung87
Copy link
Owner

bung87 commented Jan 10, 2019

I do have the same problem. Could it be caused by solargraph?

have no idea, after installing it ,never activate it , status bar always show starting the solargraph language server

@wuffo
Copy link

wuffo commented Apr 16, 2019

Same problem.

bung87.rails-unresponsive.cpuprofile.txt

@leifcr
Copy link

leifcr commented May 1, 2019

yes. it's solargraph. I recommend removing the dependency, so solargraph can be optional.

By watching 'top' on the console, I can see the ruby process for solargraph constantly running. I guess ruby language server for rails projects isn't ready for prime-time.

@bung87
Copy link
Owner

bung87 commented May 4, 2019

thank you guys! I'm still not sure what reason is, and I'm working a rails project that I enabled solargraph and vscode-rails never happened the problem you faced, and I upgrade a version that highly relys on solargraph that make this extension more simpler.

@leifcr think solargraph constantly running is not the problem as it's a ruby language server, if there is it should be the solargraph highly consuming cpu time, but I can't see it from the log.

@bung87
Copy link
Owner

bung87 commented Dec 1, 2019

does this problem still existed?
I starting manage all information I have

  1. developers report high cpu load begin at v0.8.5 make solargraph as extension dependency starts v0.9.0
    https://github.com/bung87/vscode-rails/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed+Extension+causes+high+cpu+load

so problem exists in one extension side, or both side, even it 's not as vscode-rails extension dependency, as they register same providers.

also see castwide/vscode-solargraph#116 Extension causes high cpu load
seems the author make it more efficient.

  1. this project performance related parts

    1. as rails project has standard directory struct and file name, when searching file using
      vscode.workspace.findFiles it always using most near sub path.
    2. after find file it scan line by line to get symbol info
  2. there may have a bug after let solargraph as denpendency, I also commented some lines.

// [FileType.Unkown, findLocationByWord]

it may introduce this error #45

  1. about not use solargraph as extension dependency

it's also sound make sense , leave language level extension to end user choises
the bad side is without any ruby language server, the end user must be a ruby pro.

@zarembas
Copy link

Might be a Ruby version issue. It pops up all the time on a Ruby 2.3.3 project I'm working on.

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

No branches or pull requests

6 participants