jedi-vim causes lag in insert mode
See original GitHub issueI’m experiencing an irritating lag in insert mode, i.e. it takes a long (up to 0.5 seconds) time for a character to appear after I type it. One of the files I’m having this issue with is ~800 lines of code, so I wouldn’t expect mere size to be the root cause? Removing jedi-vim also removes the lag, so I assume it must have something to do with this plugin. Completely removing my .vimrc doesn’t seem to have any effect. This happens with supertab, autocomplpop, and also when both of them are disabled.
I profiled some of the insert-mode madness like this:
:profile start profile.log
:profile func *
:profile file *
" At this point do slow actions
:profile pause
:noautocmd qall!
and it seems like _vim_exception
is being called rather often (given that I only inserted ~80 chars):
FUNCTION jedi#_vim_exceptions()
Called 313 times
Total time: 0.014491
Self time: 0.014491
count total (s) self (s)
313 0.002117 let l:result = {}
313 0.000798 try
313 0.000745 if a:is_eval
261 0.002488 let l:result.result = eval(a:str)
261 0.000370 else
52 0.002304 execute a:str
52 0.000199 let l:result.result = ''
52 0.000060 endif
313 0.000390 catch
let l:result.exception = v:exception
let l:result.throwpoint = v:throwpoint
endtry
313 0.000692 return l:result
Perhaps this is an issue with vim-jedi interacting with one of my other plugins, so here’s the global summary:
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 0.238969 0.000101 <SNR>20_UpdateErrors()
1 0.231162 0.000322 <SNR>20_CacheErrors()
2 0.229969 0.000126 SyntaxCheckers_python_GetLocList()
2 0.229843 0.000092 SyntasticMake()
2 0.229751 0.011751 SyntasticLocalMake()
3 0.053375 0.052994 <SNR>39_RunPyflakes()
1 0.019087 GetPythonIndent()
313 0.014491 jedi#_vim_exceptions()
4 0.012549 0.000207 <SNR>20_OSSupportsShellpipeHack()
2 0.012342 0.000284 <SNR>20_uname()
56 0.008552 <SNR>25_Highlight_Matching_Pair()
1 0.007604 0.000098 <SNR>20_RedrawErrors()
1 0.005281 0.000056 <SNR>20_RefreshSigns()
1 0.005174 0.005001 <SNR>20_SignErrors()
1 0.001678 0.000034 <SNR>20_AutoToggleLocList()
1 0.001599 0.000316 <SNR>20_ShowLocList()
1 0.000686 0.000206 SyntasticCheckable()
1 0.000568 0.000492 <SNR>11_LoadFTPlugin()
1 0.000495 0.000329 <SNR>5_SynSet()
5 0.000444 0.000387 <SNR>20_FilterLocList()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
3 0.053375 0.052994 <SNR>39_RunPyflakes()
1 0.019087 GetPythonIndent()
313 0.014491 jedi#_vim_exceptions()
2 0.229751 0.011751 SyntasticLocalMake()
56 0.008552 <SNR>25_Highlight_Matching_Pair()
1 0.005174 0.005001 <SNR>20_SignErrors()
1 0.000568 0.000492 <SNR>11_LoadFTPlugin()
5 0.000444 0.000387 <SNR>20_FilterLocList()
1 0.000495 0.000329 <SNR>5_SynSet()
1 0.231162 0.000322 <SNR>20_CacheErrors()
1 0.001599 0.000316 <SNR>20_ShowLocList()
2 0.012342 0.000284 <SNR>20_uname()
3 0.000239 <SNR>39_ActivatePyflakesQuickFixWindow()
1 0.000279 0.000236 <SNR>20_HightlightErrors()
1 0.000231 <SNR>15_addtomrufs()
3 0.000216 SyntasticAddToErrors()
4 0.012549 0.000207 <SNR>20_OSSupportsShellpipeHack()
1 0.000686 0.000206 SyntasticCheckable()
13 0.000159 <SNR>20_LocList()
1 0.000233 0.000147 <SNR>20_LoadChecker()
Any idea where to look or how to debug this?
Issue Analytics
- State:
- Created 10 years ago
- Comments:27 (7 by maintainers)
Top GitHub Comments
Answering my own question, looks like this worked for me:
This also worked for me. I am using supertab – when generating the completion menu it used to pause for seconds at at time.