Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

100% CPU use by the Language Server on MacOS after the latest upgrade #568

Closed
luabud opened this issue Jan 30, 2019 · 15 comments
Closed

100% CPU use by the Language Server on MacOS after the latest upgrade #568

luabud opened this issue Jan 30, 2019 · 15 comments
Labels
duplicate This issue or pull request already exists

Comments

@luabud
Copy link
Member

luabud commented Jan 30, 2019

Feedback from Twitter: https://twitter.com/HenrikOssipoff/status/1090544805539651584

Love the rapid releases, but I'm experiencing 100% CPU utilisation by the language server on macOS after the latest upgrade :( Downgrade to the previous version seems to have fixed the issue

@jakebailey
Copy link
Member

We'd need to know the language server version between both, but I'm not sure they would differ. All versions of the extension download the newest version of the language server. Maybe if they did it manually, the older extension wouldn't have downloaded an update yet...

#479

@HenrikOssipoff
Copy link

I'm the guy behind the tweet.
I'm very sorry for the inconvenience, I might've jumped the gun on this one. It appears that, after the upgrade, I opened a new code base that I hadn't opened before (a rather large one), and this is making the language server spike to a consistent 100%. I'm assuming this is because it's doing some sort of indexing or the like.

When I downgraded, I didn't touch that same code base for the rest of the day, only working on my day-to-day code bases, where no problem is.

Using the large code base, I'm at a consistent 100% on both newest and previous version.

So sorry for the trouble here, there most likely isn't any issue with the newest upgrade!

@jakebailey
Copy link
Member

No problem. On a large codebase, it's likely to take a while to "complete". The exception being symbols (workspace/document/outline) which should be available almost immediately, as well as completion for files that are already analyzed. For the most part, it should be usable even if it's still working.

There's an in progress rework which should improve performance.

@luckb0x
Copy link

luckb0x commented Feb 5, 2019

No problem. On a large codebase, it's likely to take a while to "complete". The exception being symbols (workspace/document/outline) which should be available almost immediately, as well as completion for files that are already analyzed. For the most part, it should be usable even if it's still working.

There's an in progress rework which should improve performance.

Any ETA on the in-progress re-work?

It's been running for near 24 hours now on the ~200MB codebase. If it was doing some kind of indexing, I would imagine it should be complete by now. This seems to be related to something else.

I'm experiencing the same thing.
My configuration can be found in the following thread: #479

@jakebailey
Copy link
Member

It's not doing any indexing per se. The old algorithm is iterative and reanalyzes to build type information. This can get dicey in some situations where the number of types a given variable can be keeps growing and does fully complete, hence a rework of the core analysis itself (see #479 (comment)). We've attempted to curb it by adding limits, making things more strict, but got to the end of the rope.

I don't want to give any hard dates, but you can observe progress here: https://github.com/Microsoft/python-language-server/issues?q=label%3AGA

#546 closes many issues and introduces a new LS based on the new analysis, but it is not yet feature complete and will not be the default quite yet.

@MikhailArkhipov
Copy link

MikhailArkhipov commented Feb 5, 2019

@musayev-io - our schedule is public. If you install Zenhub extension to Chrome, you should see our milestones and projected beta availability of the new LS. Ex #568 (comment). Check Release report at the left side.

@nbarraille
Copy link

I have the same issue on OSX on a repo I use every day. This makes the Python extension completely unusable (For example, trying to jump to a function definition in the same file doesn't ever complete).

@rga-odoo
Copy link

I have the same problem on OSX.
python language server process eats almost % CPU: 95-98 all the time and never complete GO to Definition. no traceback on output python

Code Version 1.31.1 (1.31.1)
OS Version: macOS Mojave (10.14.3)
Python version: 3.6.5 (all tried with env)
Microsoft Python Language Server version 0.1.78.0

@MikhailArkhipov
Copy link

Duplicate of #610

@MikhailArkhipov MikhailArkhipov marked this as a duplicate of #610 Feb 20, 2019
@MikhailArkhipov
Copy link

0.2.16 is now available on beta channel.

"python.analysis.downloadChannel": "beta"

@luckb0x
Copy link

luckb0x commented Mar 6, 2019

Mikhail - I added this to my settings.json but it says "Unknown configuration setting" and the latest release I see is 2019.2.5558. Should I be putting this setting elsewhere? Thanks!

@jakebailey
Copy link
Member

It's undocumented, so VS Code will warn about it. You can ignore this warning for testing.

@luckb0x
Copy link

luckb0x commented Mar 6, 2019

Noted! I assume all the code is already in the 2019.2.5558 release?
Please let me know if there's anything you'd like me to test or a place I can provide feedback. Thank you for delivering as promised! Great work guys 👌🏼

@MikhailArkhipov
Copy link

Language server is independent of the extension release and is compatible with that is currently out.

@jakebailey
Copy link
Member

You just need to reload VS Code to get the extension to download the new version. File bugs with analysis here. 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

7 participants