Closed jonathf closed 3 years ago
could that be a problem of the ShaDa file? can you try without such a file?
You mean ~/.local/share/nvim/shada/main.shada
?
I just tried moving it away. No effect on load time (but a new shada files was instantly created).
I did a binary search trying to locate the problem. Landed on this commit:
commit f545fa8cf2ef26a3989237ad180aba8113e886d3 (HEAD)
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Aug 22 09:57:15 2018 +0200
Make use of swap_info() function for Vim 8.1.313
Before it the plugin is fast. After it is slow. (Yeah, I know. I hadn't updated in a while.)
Interesting. Does neovim have a swap_info()
function?
No. But it has the function swapinfo
.
okay, that's what I meant.
Okay, so let's try to see if when we disable the swapinfo() function it works as fast as before. Please check the following patch:
diff --git a/autoload/recover.vim b/autoload/recover.vim
index 148108b..1f34bca 100755
--- a/autoload/recover.vim
+++ b/autoload/recover.vim
@@ -8,7 +8,7 @@
" GetLatestVimScripts: 3068 19 :AutoInstall: recover.vim
let s:progpath=(v:version > 704 || (v:version == 704 && has("patch234")) ? v:progpath : 'vim')
-let s:swapinfo=exists("*swapinfo")
+let s:swapinfo=0
let s:is_linux = has("unix") && system('uname') =~? 'linux'
fu! s:Swapname() "{{{1
Unfortunatly no difference.
Hm, too bad. Can you do some profiling
E.g. start vim/nvim with a minimal config using this way:
vim --cmd ':profile start profile.log' --cmd ':profile func *' --cmd ':profile file *' -u vimrc
and after it has start up, simply quit it :q!
and then show the profile.log file please.
SCRIPT /home/jonathf/.config/nvim/plugged/Recover.vim/autoload/recover.vim Sourced 1 time Total time: 0.413317 Self time: 0.000242
count total (s) self (s) " Vim plugin for diffing when swap file was found " --------------------------------------------------------------- " Author: Christian Brabandt cb@256bit.org " Version: 0.19 " Last Change: Thu, 15 Jan 2015 21:26:55 +0100 " Script: http://www.vim.org/scripts/script.php?script_id=3068 " License: VIM License " GetLatestVimScripts: 3068 19 :AutoInstall: recover.vim
1 0.000015 let s:progpath=(v:version > 704 || (v:version == 704 && has("patch234")) ? v:progpath : 'vim') 1 0.000005 let s:swapinfo=exists("*swapinfo") 1 0.413109 0.000034 let s:is_linux = has("unix") && system('uname') =~? 'linux'
ah okay, found it. I think I have fixed that now.
That did the trick. Thanks for the help.
I'm a long time fan of the plugin, thanks for your cotribution.
Lately as startup has become quite slow on my machine. Any idea on what is going on here?
My nvim version info:
init.rc file:
Loging startup times with:
Content of logfile:
I've tested both a minimal and my full rc setup without the recover plugin, and then everything is fast again.