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

Cache does not seem to be caching. Slow autocomplete. #1116

Closed
ClayShoaf opened this issue Oct 13, 2023 · 2 comments
Closed

Cache does not seem to be caching. Slow autocomplete. #1116

ClayShoaf opened this issue Oct 13, 2023 · 2 comments

Comments

@ClayShoaf
Copy link

Issue

When I try to do a . autocomplete, it takes a long time to load the options. I have looked at some other issues, like #163, but I have not installed any other plugins. Please see the section called "ATTENTION" as it looks like there is probably a simple solution, but I am not sure exactly what I need to add/edit in my init.vim file.

If you are not using jedi-vim from Git (but e.g. from a distribution's package,
please try it with jedi-vim's Git master, too).

I assume that's what Vundle is doing when I include the line Plugin 'davidhalter/jedi-vim' in my init.vim file, but if not, please let me know and I will see if I can install it some other way.

jedi-vim.slow.webm

Steps to reproduce

You can use the following template (save it as minimal.vimrc in the directory
where jedi-vim is installed, cd into that directory, and run Vim with
vim -u minimal.vimrc):

set nocompatible

let script_dir = fnamemodify(expand('<sfile>'), ':h')
let &runtimepath .= ','.script_dir.','.script_dir.'/after'

" Put your config changes here.
" let g:jedi#show_call_signatures=1

syntax on
filetype plugin indent on

*** ATTENTION ***

I just tried that and it significantly increased the speed on the second autocomplete! It's not the 50 ms that someone else reported, but it does go much faster, which is good.

Any idea what I should add from this to my init.vim? This is all that's in mine right now:

set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'davidhalter/jedi-vim'
call vundle#end()            " required
filetype plugin indent on    " required

set scrolloff=10

augroup AutoView
  autocmd!
  autocmd BufWinLeave * silent! mkview
  autocmd BufWinEnter * silent! loadview
augroup END

***

Output of “:verbose JediDebugInfo”

Jedi-vim debug information

jedi-vim version
  • jedi-vim git version: b82da7d
  • jedi git submodule status: 4e175ca82bbd680cb90f462545c10a8b1c0b5f2e pythonx/jedi (4e175ca)
  • parso git submodule status: ee5edaf22ff3941cbdfa4efd8cb3e8f69779fd56 pythonx/parso (ee5edaf)
Global Python

Using Python version 3 to access Jedi.

  • global sys.executable: /usr/bin/python3
  • global sys.version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
  • global site module: /usr/lib/python3.10/site.py
Jedi
  • path: /home/user/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py
  • version: 0.19.1
Jedi environment: <SameEnvironment: 3.10.12 in /usr>
  • executable: /usr/bin/python3
  • sys_path:
    • /usr/lib/python310.zip
    • /usr/lib/python3.10
    • /usr/lib/python3.10/lib-dynload
    • /home/user/.local/lib/python3.10/site-packages
    • /usr/local/lib/python3.10/dist-packages
    • /usr/lib/python3/dist-packages
Known environments
  • <Environment: 3.10.12 in /usr> (/usr/bin/python3.10)
Settings
  omnifunc=jedi#completions
	Last set from ~/.vim/bundle/jedi-vim/autoload/jedi.vim line 723
  completeopt=menuone,longest,preview
	Last set from ~/.vim/bundle/jedi-vim/plugin/jedi.vim line 40

:version


NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

:messages

:scriptnames
  1: ~/.config/nvim/init.vim
  2: /usr/share/nvim/runtime/ftoff.vim
  3: ~/.vim/bundle/Vundle.vim/autoload/vundle.vim
  4: ~/.vim/bundle/Vundle.vim/autoload/vundle/config.vim
  5: /usr/share/nvim/runtime/filetype.vim
  6: /usr/share/nvim/runtime/ftplugin.vim
  7: /usr/share/nvim/runtime/indent.vim
  8: /usr/share/nvim/runtime/syntax/syntax.vim
  9: /usr/share/nvim/runtime/syntax/synload.vim
 10: ~/.vim/bundle/jedi-vim/plugin/jedi.vim
 11: /usr/share/nvim/runtime/plugin/gzip.vim
 12: /usr/share/nvim/runtime/plugin/health.vim
 13: /usr/share/nvim/runtime/plugin/man.vim
 14: /usr/share/nvim/runtime/plugin/matchit.vim
 15: /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
 16: /usr/share/nvim/runtime/plugin/matchparen.vim
 17: /usr/share/nvim/runtime/plugin/netrwPlugin.vim
 18: /usr/share/nvim/runtime/plugin/rplugin.vim
 19: /usr/share/nvim/runtime/plugin/shada.vim
 20: /usr/share/nvim/runtime/plugin/spellfile.vim
 21: /usr/share/nvim/runtime/plugin/tarPlugin.vim
 22: /usr/share/nvim/runtime/plugin/tohtml.vim
 23: /usr/share/nvim/runtime/plugin/tutor.vim
 24: /usr/share/nvim/runtime/plugin/zipPlugin.vim
 25: ~/.vim/bundle/jedi-vim/ftplugin/python/jedi.vim
 26: ~/.vim/bundle/jedi-vim/autoload/jedi.vim
 27: /usr/share/nvim/runtime/autoload/provider/python3.vim
 28: /usr/share/nvim/runtime/autoload/provider/pythonx.vim
 29: /usr/share/nvim/runtime/autoload/remote/host.vim
 30: /usr/share/nvim/runtime/autoload/provider.vim
 31: /usr/share/nvim/runtime/ftplugin/python.vim
 32: ~/.vim/bundle/jedi-vim/after/ftplugin/python/jedi.vim
 33: /usr/share/nvim/runtime/indent/python.vim
 34: /usr/share/nvim/runtime/syntax/python.vim
 35: ~/.vim/bundle/jedi-vim/after/syntax/python.vim
 36: ~/.local/share/nvim/view/~=+programming=+python=+matplotlib=+animation.py=
 37: /usr/share/nvim/runtime/autoload/provider/clipboard.vim
@davidhalter
Copy link
Owner

Thanks for the report, but this is unfortunately a known issue of davidhalter/jedi#1059

There is not a lot we can do here for now, because this is really an architectural issue. I'm trying to fix it by rewriting Jedi in Rust, but that's still years away from completion. My type checker is probably at 50-60% (mypy clone) finished, but even that will take a long time and after that I will start with completions.

The issue you are seeing here is that some large libraries like matplotlib and numpy are just too big for Jedi's current design. I'm closing, because this is really the Jedi issue that I've linked.

@ClayShoaf
Copy link
Author

@davidhalter I appreciate the reply!

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