microsoft/python-language-server

Autocompleting `pandas.` uses 1/2 GB of memory

memeplex opened this issue · 6 comments

I just did a clean launch of vscode and tried to autocomplete pandas. as shown in the screenshot:

image

Memory usage is absurdly high. I can easily reproduce this by repeating the same steps.

I'm using:

  1. Arch Linux, everything up to date.
  2. Code 1.34.0
  3. Python Extension 2019.4.12954
  4. Python Language Server from the beta channel (I updated it minutes ago).
  5. Python 3.7.3

Also, each time I restart code it takes a long time to re-analyze everything (and reload everything into memory!), it's like it doesn't cache anything between sessions and has a long initialization time.

Compare with jedi:

  • It's using less than 200MB with both numpy and pandas imported.
  • Startup latency is less than 10 seconds (vs 40 seconds to 1 minute).

Caching is part of #472. Considering memory, Jedi is only for completions. Rename is handled by rope, symbols by ctags and linting by pylint. LS actually combines them all. 500 MB is not particularly different from other comparable engines.

Since we have #832, folding into #472 for caching.

Fair enough, thanks for explaining. When I disable Jedi in my settings, does it mean that everything else you listed above is disabled also so that pls takes care of everything?

Yes, LS takes over the entire editor. Pylint may still be activated since LS linting is not yet as complete.