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

Numpy and Scipy slow on completion. #1218

Closed
hifall opened this issue Sep 13, 2018 · 1 comment
Closed

Numpy and Scipy slow on completion. #1218

hifall opened this issue Sep 13, 2018 · 1 comment

Comments

@hifall
Copy link

hifall commented Sep 13, 2018

I use Palantir's Python Language Server (PLS) for Python code completion. PLS in turn uses Jedi as the completion engine.

I found that triggering the completion list is very slow for Numpy and Scipy on a VPS. It takes 15 seconds for Numpy and 10+ seconds for Scipy respectively.

There are already some performance issues raised about Jedi in the community. But none of them is about Numpy or Scipy.

I wonder if this is a known issue?

@davidhalter
Copy link
Owner

It's a known issue that Jedi is slow for numpy, but it's definitely not that slow. Sometimes the first time you try to complete numpy it takes a few seconds (maybe 5), but after that completions should be pretty fast.

TLDR; I checked and your VPS sucks ass, because the https://cloudscale.ch servers are way faster.


I just checked with the cloud servers of my company (cloudscale.ch), and these are the results:

>>> from timeit import timeit
>>> import jedi
>>> timeit("jedi.Script('import numpy; numpy.').completions()", globals=globals(), number=1)
3.0075249230000054
>>> timeit("jedi.Script('import numpy; numpy.').completions()", globals=globals(), number=1)
0.23607791599999928

This means that the first completions takes 3 second and everyone following it 230 ms. It's a bit slower on my computer, it takes about 420 ms. I'm not saying that's good, but it's way better than 15s. I'm also aware of exactly that half a second for a completion problem, but that's known and is probably going to be solved, once we have an index (see #1059).

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

No branches or pull requests

2 participants