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

[with-list] Can jedi-vim get more smooth like emacs-jedi ?? #654

Closed
skywind3000 opened this issue Jan 10, 2017 · 3 comments
Closed

[with-list] Can jedi-vim get more smooth like emacs-jedi ?? #654

skywind3000 opened this issue Jan 10, 2017 · 3 comments

Comments

@skywind3000
Copy link

skywind3000 commented Jan 10, 2017

I love jedi-vim very much, but the performance is a big trouble to me, especially when I press a dot ".", vim get stucked for 3-4 seconds which is very annoyed.

When I switch to emacs with a similar package emacs-jedi, I find it is far more smooth than jedi-vim . I have no idea about the difference. Both of them are using jedi as the backend, and both of them are using a client/server architecture.

After some inspection, I finally figure out there is an obvious difference between jedi-vim and emacs-jedi: The http timeout

What jedi-vim does is:

  1. request the 'jedi-server'
  2. wait the http request until timeout happen (2-4 seconds).

the waiting method here will definitely block the ui, and users can do nothing during 2-4 seconds.

What emacs-jedi does is:

  1. request the 'emacs-jedi-server' and returns immediately, so you can continue editing.
  2. when respones returns and if cursor is still at the same position and no new characters have entered or deleted, popup the completion menu.
  3. when response returns and if cursor has moved or text has been changed, drop the response directly and do nothing.

So there is no 'http timeout' in emacs-jedi, absolutely emacs-jedi got the right way and get more snappy than jedi-vim.

And I suppose is it possible to provide an non-blocking http request mechanism by introducing +timers from vim8/neovim:

  1. post http request to jedi-server and return immediately.
  2. poll the response repeatly in an interval (20Hz eg), this will not block the ui
  3. when response returns in the timer, if cursor is still at the same position and no new characters have been entered or deleted, popup the completion menu.
  4. when response returns and if cursor has moved or text has been changed, drop the response directly and do nothing.

This is exactly what the most completion packages of emacs does.

There are many people are complain about the performance from 2013-2017: #163

If we can introduce this http polling method in jedi-vim, completion can be as smooth as emacs and jedi-vim will make vim great again !!

@blueyed
Copy link
Collaborator

blueyed commented Jan 10, 2017

I recommend to use https://github.com/zchee/deoplete-jedi/ for completions.
Requires Neovim though.

@skywind3000
Copy link
Author

I am sad to say as a windows user who uses gvim.exe everyday, I can't profit anything from Neovim.

There are still high priority bugs on windows, I have found two issues:

neovim/neovim#5844
neovim/neovim#5843

It seems it could not be solved easily or in a short time.

@davidhalter
Copy link
Owner

There's deoplete and YCM that both allow you to have asynchronous completions. I think that's enough for now. I might be building a client within Jedi, but before that jedi-vim is probably not getting something like this.

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

3 participants