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
Hi guys, I have written some moderately elaborate python code for Vim, and I have found that vanilla vim runs my python code a little bit less than one hundred times faster than in neovim.
Now I'm using the python << EOF method of writing the python, and I havent refactored it out into its own plugin yet. it's still all quite experimental.
But I'm just flabbergasted by the amount of performance difference and I wonder if maybe vim is compiling the python and neovim is for whatever reason always interpreting it?
Even still I'm not really doing enough work to justify it spending so much time.
Looking for tips on how to continue debugging this.
The text was updated successfully, but these errors were encountered:
for line in win.buffer is correct, it fetches the entire buffer once. The problem might be the win.width inside the innermost (line) loop. If you move it out before the loop (width = win.width, as already is done for height), does the difference decrease?
@unphased Vim contains embedded interpter. I.e. it links with libpython and vim.* objects directly call C code. Neovim uses msgpack-rpc so anything like vim.buffer.__getitem__(1) (vim.buffer[1]) is doing “form request -> serialize it in msgpack -> deserialize it on Neovim side -> form the response -> serialize it -> deserialize on the Python side”. Plus the OS doing context switches because Python interpreter is one process and Neovim is another. In Vim this is “convert Python object to Vim -> call some C functions -> convert return value of C functions to Python”, and no necessary context switches. This has nothing to do with compiling/interpreting: libpython is the same both in Vim and Neovim cases. But this is IPC that slows down things which is never going to be just as fast, main optimization strategy here is reducing the number of requests (like suggestion by @bfredl).
Hi guys, I have written some moderately elaborate python code for Vim, and I have found that vanilla vim runs my python code a little bit less than one hundred times faster than in neovim.
The code can be found starting here.
Now I'm using the
python << EOF
method of writing the python, and I havent refactored it out into its own plugin yet. it's still all quite experimental.But I'm just flabbergasted by the amount of performance difference and I wonder if maybe vim is compiling the python and neovim is for whatever reason always interpreting it?
Even still I'm not really doing enough work to justify it spending so much time.
Looking for tips on how to continue debugging this.
The text was updated successfully, but these errors were encountered: