Shougo / denite.nvim

:dragon: Dark powered asynchronous unite all interfaces for Neovim/Vim8
Other
2.06k stars 215 forks source link

:Denite file/rec is slow with multiple buffers/splits #555

Closed mMontu closed 5 years ago

mMontu commented 5 years ago

Problems summary

As mentioned at #548, on certain occasions I'm experiencing large delays when running Denite commands such as :Denite file/rec. It seems to change with the specific filetype and number of buffers/splits/tabs open, but in one case running :Denite file/rec after opening a given file in fresh Vim instance takes around 0.5 seconds ( measured with the command mentioned below), but opening several other files in tabs and splits (e.g.: 6 tabs with 2 to 5 window split each) causes :Denite file/rec to take more than 1.5 seconds to return.

Expected

Number of windows/buffers/tab pages to be irrelevant to the plugin. No noticeable change in performance when multiple files are open, delay smaller than 1 second.

Environment Information (Required!)

Provide a minimal init.vim with less than 50 lines (Required!)

Reproducible without init file.

How to reproduce problems from neovim startup (Required!)

Despite the issue is most evident with some filetypes that (probably) have more complex syntax definition, such as vimwiki and robot, it can also be reproduced with vanilla Vim:

$ mkdir test_Denite
$ cd test_Denite
$ touch abc def ghi
$ gvim -u NONE -U NONE -N -i NONE
set nocompatible
syntax on
let &rtp.=','.$HOME.'/.vim/bundle/denite.nvim'
source ~/.vim/bundle/denite.nvim/plugin/denite.vim
set lines=1000 columns=1000  " maximize window, as for some reason it increases the delay

let start = reltime() | exe "normal :Denite file/rec\<cr>\<esc>\<esc>" | redraw | echom reltimestr(reltime(start))
let start = reltime() | exe "normal :Denite file/rec\<cr>\<esc>\<esc>" | redraw | echom reltimestr(reltime(start))
" >>> note it echoes a small value, on my pc it is 0.15 seconds

rightb vs $VIMRUNTIME/filetype.vim
rightb sp $VIMRUNTIME/syntax/xs.vim
wincmd t
rightb sp $VIMRUNTIME/autoload/netrw.vim
rightb sp $VIMRUNTIME/autoload/phpcomplete.vim
wincmd t

let start = reltime() | exe "normal :Denite file/rec\<cr>\<esc>\<esc>" | redraw | echom reltimestr(reltime(start))
" >>> note it echoes a larger value, on my pc it is 0.45 seconds
Shougo commented 5 years ago

I have tested it and I don't reproduce the problem.

0.4444 No split no cached
0.2555 No split cached
0.2555 No split cached

0.2888 split cached
0.27... split cached
...

It is just terminal/Vim performance problem in vertical split.