vim-gina
vim-gina copied to clipboard
High CPU load on bigger branch
When I open Neovim (version 0.3.0 without any session or any file) on repository folder with branch checked (with 145 commits ahead of master) the CPU load of nvim instance goes to 57 - 60% and stays there. Is gina.vim doing any computation in background that could cause this?
Uninstalling gina solved CPU load problem or switching branch to master. I have latest macOS and I'm not doing anything special in my nvim config with gina:
Plug 'lambdalisue/gina.vim'
set statusline=%(\ %m%r%h%w%)\ %t\ %7l,%02c\ %=\ %#error#%{&paste?'\ [paste]\ ':''}%*\ [%{&ff}]\ %y\ %{gina#component#repo#preset()}\
" -- Git G -- {{{2
nnoremap <space>gs :Gina status --short<cr>
nnoremap <space>gr :Gbranch<cr>
nnoremap <space>gb :Gina blame<cr>
nnoremap <space>gc :Gina commit -v<cr>
nnoremap <space>gl :Gina log<cr>
nnoremap <space>gm :Gina compare<cr><C-w>L
nnoremap <space>gp :Gina push
nnoremap <space>gd :Gina diff<cr>
" Echo chunk info with j/k in blame window
call gina#custom#mapping#nmap('blame', 'j', 'j<Plug>(gina-blame-echo)')
call gina#custom#mapping#nmap('blame', 'k', 'k<Plug>(gina-blame-echo)')
" show commit preview
call gina#custom#mapping#nmap('blame', 'o', ':<C-u>call gina#action#call("show:commit:preview:bottom")<CR>', {'noremap': 1, 'silent': 1})
call gina#custom#mapping#nmap('log', 'o', ':<C-u>call gina#action#call("show:commit:preview:bottom")<CR><c-w>H', {'noremap': 1, 'silent': 1})
" diff on file
call gina#custom#mapping#nmap('status', 'o', ':<C-u>call gina#action#call("diff:preview:bottom")<CR><c-w>H', {'noremap': 1, 'silent': 1})
call gina#custom#mapping#nmap('status', '<cr>', ':<C-u>call gina#action#call("edit")<CR>', {'noremap': 1, 'silent': 1})
" }}}
OK, I found the issue. It is in statusline. When I comment out statusline the CPU load goes to zero. If you think there's no way of optimizing %{gina#component#repo#preset()} then close this issue.
Thanks for the investigation. Could you check which one causes the issue
gina#component#repo#name()gina#component#repo#branch()gina#component#repo#track()
I guess the last one.
Yes, the last one: gina#component#repo#track().
Thanks. I'll consider to make it fully async.
Sorry for late. It's under testing but could you try if https://github.com/lambdalisue/gina.vim/pull/183 solves your problem? @peaceant