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 start in neovim #176

Closed
2 of 6 tasks
meijieru opened this issue Jun 20, 2018 · 6 comments
Closed
2 of 6 tasks

slow start in neovim #176

meijieru opened this issue Jun 20, 2018 · 6 comments

Comments

@meijieru
Copy link

  • vim or neovim?
    • vim
    • neovim
  • vim --version or nvim --version:
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +jemalloc +tui 
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
  • Output of :echo has("python"): 1
  • Output of :echo has("python3"): 1
  • Output of :echo &pythondll(only vim, not neovim):
  • Output of :echo &pythonthreedll(only vim, not neovim):
  • Output of :py print(sys.version):
  • Output of :py3 print(sys.version): 3.6.5 (default, May 11 2018, 04:00:52) [GCC 8.1.0]
  • Operating system:
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Configurations related to LeaderF in vimrc:
    " LeaderF
    let g:Lf_ShortcutF = '<leader>ff'
    let g:Lf_ShortcutB = '<leader>fb'
    nnoremap <leader>fm :LeaderfMru<cr>
    nnoremap <leader>fc :LeaderfFunction!<cr>
    nnoremap <leader>fl :LeaderfBufTag!<cr>
    nnoremap <leader>ft :LeaderfTag<cr>

    let g:Lf_RootMarkers = g:root_markers
    let g:Lf_WorkingDirectoryMode = 'Ac'
    let g:Lf_WindowHeight = 0.35
    let g:Lf_CacheDirectory = g:runtime_root . 'cache'
    let g:Lf_ShowRelativePath = 1
    let g:Lf_StlColorscheme = 'default'
    let g:Lf_StlSeparator = { 'left': '', 'right': '' }
    let g:Lf_MruMaxFiles = 2048
    let g:Lf_StlColorscheme = 'gruvbox'
    let g:Lf_PreviewResult = {'Function':1, 'BufTag':0}
    let g:Lf_NormalMap = {
                \ 'File':   [['<ESC>', ':exec g:Lf_py "fileExplManager.quit()"<CR>']],
                \ 'Buffer': [['<ESC>', ':exec g:Lf_py "bufExplManager.quit()"<CR>']],
                \ 'Mru':    [['<ESC>', ':exec g:Lf_py "mruExplManager.quit()"<CR>']],
                \ 'Tag':    [['<ESC>', ':exec g:Lf_py "tagExplManager.quit()"<CR>']],
                \ 'Function':    [['<ESC>', ':exec g:Lf_py "functionExplManager.quit()"<CR>']],
                \ "BufTag":    [["<ESC>", ':exec g:Lf_py "bufTagExplManager.quit()"<CR>']],
                \ 'Colorscheme':    [['<ESC>', ':exec g:Lf_py "colorschemeExplManager.quit()"<CR>']],
                \ }

Describe your question, feature request, or bug.

In neovim, startup takes around 140ms, while in vim only around 40ms.
Any way to speedup the startup process?

@Yggdroot
Copy link
Owner

Firstly, you don't have to set let g:Lf_NormalMap=... now, <esc> has the behavior by default.

Currently, I don't know how to speed up the startup.

PYTHON PROVIDER CONFIGURATION
                                                 g:python_host_prog
                                                 g:python3_host_prog
 Program to use for evaluating Python code. Setting this makes startup faster.
 Also useful for working with virtualenvs.
     let g:python_host_prog  = '/path/to/python'
     let g:python3_host_prog = '/path/to/python3'

This may help.

@meijieru
Copy link
Author

I have set these values to speedup pythonx.vim

Yggdroot added a commit that referenced this issue Jun 26, 2018
move much code to autoload
only load python module when LeaderF's command is executed.
@Yggdroot
Copy link
Owner

Fixed.
How did you draw the picture of startup time?

@meijieru
Copy link
Author

By profiler

@Yggdroot
Copy link
Owner

Thanks. Could you confirm whether the fix can reduce the startup time please?

@meijieru
Copy link
Author

Yeah, the startup time reduce significantly.
Thanks

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

No branches or pull requests

2 participants