Closed achilleas-k closed 7 years ago
it looks like its denite#vim#_start
that is so slow. This is a denite function, so please assign there.
The way I read it is that denite#vim#_start
takes a few seconds (16), but that only happens once. The scrolling however triggers airline#highlighter#highlight()
, which is called 651 times and takes up 14 seconds. Am I reading it wrong?
the log file was to long and the denite#vim#_start was the first thing that I noticed. Performance issue is handled separatly in a different issue.
I will go ahead and optn an issue on Denite as well though, since I think you're right that the root cause might be there.
This is denite asynchronous update problem. I will fix it later.
In airline#extensions#denite#check_denite_mode airline highlight is called every time Correct me if I am wrong, but isn't the call to highlight required only if the mode changed? By modifying the function to check the previous mode, it avoids many redundant calls to the highlight function
function! airline#extensions#denite#check_denite_mode(bufnr)
let l:mode = split(denite#get_status_mode(), ' ')
let l:mode = tolower(l:mode[1])
if !exists('b:denite_mode') || l:mode != b:denite_mode
call airline#highlighter#highlight([l:mode], a:bufnr)
endif
let b:denite_mode = l:mode
return ''
endfunction
In airline#extensions#denite#check_denite_mode airline highlight is called every time Correct me if I am wrong, but isn't the call to highlight required only if the mode changed?
No. Please read the code. The cache feature is already implemented.
https://github.com/Shougo/denite.nvim/blob/master/rplugin/python3/denite/ui/default.py#L360
:redrawstatus
is called if the statusline is changed.
You think it should be updated only if the mode changed
.
It should not. The statusline has more information.
The problem was that the airline highlighting function itself should only be called if the mode changed (and not if the sources, path or line number have changed) The airline highlight function doesn't need to be called every time, as the highlighting stays even after airline redraws its status
The airline highlight function doesn't need to be called every time, as the highlighting stays even after airline redraws its status
Hm. I don't know the airline highlight implementation. It is the airline extention problem.
so is this still a problem, considering that I just merged the mentioned improvement to the denite extension #1489?
there is another extension, tmuxline, that causes the same delay when leaving the denite buffer.
environment
actual behavior
Extremely unresponsive scrolling of Denite buffer when airline is enabled. This stops happening if airline is rolled back to d46fb524bde7571fe55d15b16665e8eb38d1ffbd (the last commit before denite support was included).
The unresponsiveness is so slow that holding
j
in the denite buffer for a second and then releasing will continue scrolling the buffer for another few seconds.Filtering is also much slower.
expected behavior
Responsive scrolling and filtering.
Minimal vimrc and profile.log
With the following minimal vimrc:
The following profile.log was produced:
Click to expand
``` SCRIPT /usr/share/vim/vim80/scripts.vim Sourced 1 time Total time: 0.000799 Self time: 0.000799 count total (s) self (s) " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar