python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

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

Open luabud opened this issue 7 years ago • 15 comments

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

luabud avatar Jan 30 '19 17:01 luabud

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

jakebailey avatar Jan 30 '19 17:01 jakebailey

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!

HenrikOssipoff avatar Jan 30 '19 18:01 HenrikOssipoff

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.

jakebailey avatar Jan 30 '19 19:01 jakebailey

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: https://github.com/Microsoft/python-language-server/issues/479

luckb0x avatar Feb 05 '19 01:02 luckb0x

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 https://github.com/Microsoft/python-language-server/issues/479#issuecomment-453196291). 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.

jakebailey avatar Feb 05 '19 01:02 jakebailey

@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 https://github.com/Microsoft/python-language-server/issues/568#workspaces/python-language-server-5b897936af3c0a2186966c0f/reports. Check Release report at the left side.

MikhailArkhipov avatar Feb 05 '19 01:02 MikhailArkhipov

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).

nat-e avatar Feb 06 '19 07:02 nat-e

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

rga-odoo avatar Feb 14 '19 09:02 rga-odoo

Duplicate of #610

MikhailArkhipov avatar Feb 20 '19 21:02 MikhailArkhipov

0.2.16 is now available on beta channel.

"python.analysis.downloadChannel": "beta"

MikhailArkhipov avatar Mar 06 '19 22:03 MikhailArkhipov

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!

luckb0x avatar Mar 06 '19 23:03 luckb0x

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

jakebailey avatar Mar 06 '19 23:03 jakebailey

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 👌🏼

luckb0x avatar Mar 06 '19 23:03 luckb0x

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

MikhailArkhipov avatar Mar 06 '19 23:03 MikhailArkhipov

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

jakebailey avatar Mar 06 '19 23:03 jakebailey