You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Completions for python-igraph are typically very slow, but the speed depends drastically on the current working directory.
If vim is run in ~, the code
from igraph import Graph
g = Graph()
g.
takes over 30 seconds to complete. The completion becomes faster if the current working directory is better isolated from other directories. (The examples below will hopefully help to clarify what I mean by this; unfortunately I don't know how to give a precise characterization of "isolated".)
Steps to reproduce
After cd'ing into the following directories:
~
~/Python/empty (an empty directory, but ~/Python contains all my Python projects and scripts)
<Environment: 3.11.7 in /home/ilkka/mambaforge/envs/3.11> (/home/ilkka/mambaforge/envs/3.11/bin/python)
<Environment: 3.11.7 in /home/ilkka/mambaforge/envs/3.11> (/home/ilkka/mambaforge/envs/3.11/bin/python3.11)
<Environment: 3.10.12 in /usr> (/usr/bin/python3.10)
Settings
omnifunc=jedi#completions
Last set from ~/.vim/plugged/jedi-vim/autoload/jedi.vim line 723
completeopt=menuone,longest,popup
Last set from ~/.vim/plugged/jedi-vim/autoload/jedi.vim line 701
Unfortunately this is kind of a known issue. Because there's no index, there's all sorts of "slow" things going on. See also davidhalter/jedi#1059.
I'm currently rewriting Jedi/Mypy in Rust to avoid this issue.
There might still be hope here. We could theoretically disable a certain kind of functionality in case of imported modules, that would make this issue quite a bit faster. I'm thinking about that.
Thanks for the insight, and for the plugin, which has served me well for several years.
I had already resigned to using ~/empty/directory/with/no/python/anywhere/in/sight as a workaround when working with python-igraph. However, I eventually found asyncomplete.vim, which seems to be a better solution. It does give very speedy completions when Jedi is used as the language server.
Yes, that makes complete sense. I definitely feel like there might be better solutions out there for Jedi completions than jedi-vim. The thing that many of these don't do is the other stuff like gotos.
Issue
Completions for python-igraph are typically very slow, but the speed depends drastically on the current working directory.
If vim is run in
~
, the codetakes over 30 seconds to complete. The completion becomes faster if the current working directory is better isolated from other directories. (The examples below will hopefully help to clarify what I mean by this; unfortunately I don't know how to give a precise characterization of "isolated".)
Steps to reproduce
After cd'ing into the following directories:
~
~/Python/empty
(an empty directory, but~/Python
contains all my Python projects and scripts)~/empty/directory/with/no/python/anywhere/in/sight
I start vim and type the code
In case 1, the completion takes over 30 seconds, in case 2 it takes about 3 seconds, and in case 3 it happens basically instantaneously.
Tab completion in ipython is instantaneous in all three cases.
Vim is run with a minimal .vimrc that uses vim-plug to load only jedi-vim:
Output of “:verbose JediDebugInfo”
Jedi-vim debug information
jedi-vim version
Global Python
Using Python version 3 to access Jedi.
/home/ilkka/mambaforge/envs/3.11/bin/python3
3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
/home/ilkka/mambaforge/lib/python3.10/site.py
Jedi
/home/ilkka/.vim/plugged/jedi-vim/pythonx/jedi/jedi/__init__.py
Jedi environment: <Environment: 3.11.7 in /home/ilkka/mambaforge/envs/3.11>
/home/ilkka/mambaforge/envs/3.11/lib/python311.zip
/home/ilkka/mambaforge/envs/3.11/lib/python3.11
/home/ilkka/mambaforge/envs/3.11/lib/python3.11/lib-dynload
/home/ilkka/mambaforge/envs/3.11/lib/python3.11/site-packages
Known environments
<Environment: 3.11.7 in /home/ilkka/mambaforge/envs/3.11> (/home/ilkka/mambaforge/envs/3.11/bin/python)
<Environment: 3.11.7 in /home/ilkka/mambaforge/envs/3.11> (/home/ilkka/mambaforge/envs/3.11/bin/python3.11)
<Environment: 3.10.12 in /usr> (/usr/bin/python3.10)
Settings
:version
:messages
:scriptnames
The text was updated successfully, but these errors were encountered: