jedi-vim: jedi-vim is too too slow

$vim test.py

import os, sys
os.

– and then vim is fronzened for a few seconds.
I found it’s really very slow while trying auto-comple by jedi-vim.

So, what can I do ?


OS: 64bit Debian/testing Dist CPU: AMD IIx4 2.8GHz

Installed jedi-vim by vundle

Configured jedi-vim with: "For jedi-vim: "pip install jedi – done let g:jedi#autocompletion_command = “< tab>”

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Reactions: 7
  • Comments: 46 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Same problem fo rme. For numpy the stall is the range of 10 seconds. The stall is not only the first time, it is every time. No stall for my own codebase (rather small compared to numpy).

vim 7.3.744 jedi 0.7.0 jedi-vim master today linux

Any experiment i can do to give more info?

And, really, if you’re going to be using vim, you should use Neovim.

@vatrat

Not sure why this is still a problem after 3 years or so.

Apparently nobody cares enough to debug and fix it?!

3 years later i still have problems regarding speed. python-mode not installed importing the pytorch library and with that i am waiting like 10 seconds…

@sergeant-wizard deoplete / deoplete-jedi is also a good option, but requires you to use Neovim.

I was also getting an unacceptable delay with numpy so I dug into the code and found out that jedi.parser.cache.save_module was consuming a significant amount of time with use_filesystem_cache=True (default, perhaps to save memory usage?).

The table below is what I measured on my Ubuntu 14.04 with Intel® Core™ i5-6300U CPU @ 2.40GHz & SSD, in milliseconds.

use_filesystem_cache True False
os 380 220
numpy 7000 2100
scipy 7000 2150
pandas 450 250
import jedi

s = 'import numpy ; numpy.'
script = jedi.Script(s, 1, len(s), '')
script.completions()

That said, I guess I should also look for async approaches like https://github.com/davidhalter/jedi/issues/385 or YCM.

Since all of this seems to be related to python-mode, I’m just closing it. @dbrgn added a note that jedi-vim conflicts with python-mode. Uninstall it or uninstall jedi-vim. At the moment it’s apparently not possible to use them both. python-mode will start using Jedi at some point anyway (once refactoring is ready). At that point we can talk again.

Quoting myself from #250:

But it’s not really a jedi-vim issue, since jedi-vim is at the moment a small and lightweight plugin, compared to python-mode. I think the problem is probably on the python-mode side, because they do a thousand different things (like debugging, etc).

i.e. you just have to decide at the moment which plugin to use. Jedi will introduce refactoring at some point, but we still need to improve the parser at the moment.

Apparently, i my case this is related to python-mode. After disabling python-mode jedi-vim runs fine. The issue is both with the latest master and develop branch of python-mode.