neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
82.71k stars 5.66k forks source link

6x times slower startup than VIM on same config #11143

Closed petRUShka closed 5 years ago

petRUShka commented 5 years ago

vim-orgmode plugin works on Neovim 6x times slower than on Vim with exactly same config. Benchmarking via --startuptime option.

So bare nvim/vim sharing the config with each other consisting of only one plugin (and one dependency plugin). Opening with them same huge file (10000 lines) very different process in sense of speed.

Steps to reproduce using nvim -u vimrc_minimal

vimrc_minimal:

set nocompatible
set runtimepath^=~/.vim runtimepath+=~/.vim/after
call plug#begin('~/.vim/plugged')
Plug 'jceb/vim-orgmode'
Plug 'tpope/vim-speeddating'
call plug#end()

set iskeyword+=:

filetype plugin indent on
syntax enable

File to open:

test.org

* Tasks
** TODO My task number 1
** TODO My task number 1
** TODO My task number 1
...

So it is basically 10000 times repeated line ** TODO My task number 1

Actual behaviour

nvim -u vimrc_minimal test.org --startuptime nvim.log nvim.log: http://dpaste.com/11M4AHP

Quotation from nvim.log:

...
122.485  000.004: editing files in windows
15381.376  15258.891: VimEnter autocommands
...

Expected behaviour

vim -u vimrc_minimal test.org --startuptime vim.log vim.log: http://dpaste.com/2MKVM5P

...
057.128  000.002: editing files in windows
2616.079  2558.951: VimEnter autocommands
...
blueyed commented 5 years ago

Is vim-speeddating required to trigger it?

It would be better to have profiling output (see :h :profile), which would then show more information about where the time is spent.

justinmk commented 5 years ago

vim-orgmode is written in python. Until proven otherwise, this is almost certainly a duplicate of #1898 / #7063.

see also

petRUShka commented 5 years ago

You are right. It should be python.

Quotation from profile log:

FUNCTION  provider#python3#Call()
    Defined: /usr/share/nvim/runtime/autoload/provider/python3.vim line 26
Called 10007 times
Total time:  14.891349
 Self time:  14.840843
justinmk commented 5 years ago

Note that vim-orgmode could probably fix this by simply getting buffer contents in a batch, doing its work, then sending the updates in a batch. Instead of going back-and-forth from Vim to Python.