Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow startup #116

Closed
moeshin opened this issue Dec 21, 2021 · 4 comments · Fixed by #117
Closed

Slow startup #116

moeshin opened this issue Dec 21, 2021 · 4 comments · Fixed by #117

Comments

@moeshin
Copy link
Contributor

moeshin commented Dec 21, 2021

Test by vim-plugins-profile

Version: 85e95ac (115.252ms + python3.vim 199.277ms + python.vim 33.633ms)

❯ perl vim-plugins-profile.pl nvim
Assuming your vimfiles folder is /home/moeshin/.vim.
Generating nvim startup profile...
vim-plug has been detected.
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/autoload/provider/python3.vim: (199.277ms) *******************************************************************************************************************************************************************************************************
                  vim-wakatime (plugged): (115.252ms) *******************************************************************************************************************
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/filetype.vim: (49.358ms) *************************************************
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/autoload/provider/python.vim: (33.633ms) *********************************
/home/moeshin/.local/share/nvim/site/autoload/plug.vim: (4.437ms) ****
     /home/moeshin/.config/nvim/init.vim: (4.067ms) ****
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/syntax/syntax.vim: (3.329ms) ***
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/scripts.vim: (1.936ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/ftoff.vim: (1.763ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/netrwPlugin.vim: (1.466ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/matchit.vim: (1.009ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/gzip.vim: (0.824ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/syntax/synload.vim: (0.570ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/autoload/remote/host.vim: (0.453ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim: (0.441ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tohtml.vim: (0.420ms)

/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/rplugin.vim: (0.416ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/zipPlugin.vim: (0.413ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/matchparen.vim: (0.409ms)


                    /home/moeshin/.vimrc: (0.357ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tarPlugin.vim: (0.337ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/shada.vim: (0.321ms)


/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/man.vim: (0.254ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/autoload/provider/pythonx.vim: (0.245ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/ftplugin.vim: (0.172ms)


/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tutor.vim: (0.093ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/indent.vim: (0.090ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/spellfile.vim: (0.080ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/health.vim: (0.052ms)
No GNUplot found. Skip plotting.

Version: 9.0.1 (147.058ms)

❯ perl vim-plugins-profile.pl nvim
Assuming your vimfiles folder is /home/moeshin/.vim.
Generating nvim startup profile...
vim-plug has been detected.
                  vim-wakatime (plugged): (147.058ms) ***************************************************************************************************************************************************
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/filetype.vim: (30.126ms) ******************************


/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/netrwPlugin.vim: (4.807ms) ****
     /home/moeshin/.config/nvim/init.vim: (3.124ms) ***
/home/moeshin/.local/share/nvim/site/autoload/plug.vim: (2.485ms) **
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/syntax/syntax.vim: (2.085ms) **
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/scripts.vim: (1.122ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/ftoff.vim: (1.094ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/matchit.vim: (1.008ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/gzip.vim: (0.591ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim: (0.353ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/zipPlugin.vim: (0.320ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/rplugin.vim: (0.303ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/syntax/synload.vim: (0.295ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/matchparen.vim: (0.290ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/shada.vim: (0.281ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tarPlugin.vim: (0.268ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tohtml.vim: (0.264ms)
                    /home/moeshin/.vimrc: (0.204ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/man.vim: (0.176ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/ftplugin.vim: (0.148ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/indent.vim: (0.104ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/health.vim: (0.050ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/spellfile.vim: (0.048ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tutor.vim: (0.038ms)
No GNUplot found. Skip plotting.

Version: 8.0.0 (25.444ms)

❯ perl vim-plugins-profile.pl nvim
Assuming your vimfiles folder is /home/moeshin/.vim.
Generating nvim startup profile...
vim-plug has been detected.
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/filetype.vim: (37.931ms) *************************************
                  vim-wakatime (plugged): (25.444ms) *************************

/home/moeshin/.local/share/nvim/site/autoload/plug.vim: (3.663ms) ***
     /home/moeshin/.config/nvim/init.vim: (3.568ms) ***
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/syntax/syntax.vim: (3.368ms) ***
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/scripts.vim: (2.072ms) **
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/ftoff.vim: (1.399ms) *
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/netrwPlugin.vim: (0.786ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/matchit.vim: (0.661ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/gzip.vim: (0.603ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim: (0.485ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/matchparen.vim: (0.340ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/rplugin.vim: (0.329ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/zipPlugin.vim: (0.326ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tohtml.vim: (0.286ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/syntax/synload.vim: (0.272ms)
                    /home/moeshin/.vimrc: (0.256ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tarPlugin.vim: (0.246ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/shada.vim: (0.188ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/man.vim: (0.140ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/indent.vim: (0.079ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/ftplugin.vim: (0.078ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/spellfile.vim: (0.048ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/tutor.vim: (0.043ms)
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.6.0/share/nvim/runtime/plugin/health.vim: (0.029ms)
No GNUplot found. Skip plotting.
@alanhamlett
Copy link
Member

Is debug mode enabled in your ~/.wakatime.cfg file?

@moeshin
Copy link
Contributor Author

moeshin commented Dec 22, 2021

Is debug mode enabled in your ~/.wakatime.cfg file?

No

@moeshin
Copy link
Contributor Author

moeshin commented Dec 22, 2021

Enable debug, no log file ~/.wakatime.log after startup.

@alanhamlett
Copy link
Member

Here's the function that runs when Vim starts and connects to GitHub to check for new wakatime-cli versions:

function! s:InstallCLI(use_external_python)

We need to find out which method it's using:

  • System Python (Vim async)
  • System Python (Vim sync)
  • Roundabout via Vim in background
  • Embedded Python (the only method that should cause slow startup time)

If the last method is used, slow startup can be expected and I'm not sure how to make it faster. Otherwise if the first 3 methods are used then slow startup is a bug we can probably fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants