Giter VIP home page Giter VIP logo

Comments (6)

roxma avatar roxma commented on June 3, 2024

I'll look into that. Thanks.

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

Two main causes according to my tests using minimal vimrc:

set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8
source /data/roxma/.local_software/neovim/plugins/vim-plug/plug.vim

call plug#begin('/data/roxma/test/starttime')
Plug 'roxma/nvim-completion-manager'
call plug#end()
  1. NCM uses jobstart function to start ncm process. deoplete uses neovim's builtin rplugin framework. This is a main difference. On my machine this takes about 100ms.

  2. The other cause is really wierd.

I have an autocmd call a script local function, then the script local function calls autoload function cm#..., If I move the script local function to the same file as the autoload function. The startup time is changed from 380ms to 66ms. And the time overhead of jobstart function is also reduced to a very small value (haven't test it since the total time is really small now).

This should be a neovim issue.

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

Test before add after this commit with minimal vimrc provided before:

before:


times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.013  000.013: --- NVIM STARTING ---
000.305  000.292: locale set
000.924  000.619: inits 1
000.936  000.012: window checked
001.183  000.247: parsing arguments
001.186  000.004: expanding arguments
001.241  000.054: inits 2
001.385  000.144: init highlight
002.711  000.839  000.839: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/syntax/syncolor.vim
002.940  001.207  000.368: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/syntax/synload.vim
020.843  017.800  017.800: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/filetype.vim
020.967  019.379  000.373: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/syntax/syntax.vim
021.105  000.019  000.019: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/filetype.vim
021.303  000.064  000.064: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/ftplugin.vim
021.479  000.056  000.056: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/indent.vim
024.265  002.656  002.656: sourcing /data/roxma/.local_software/neovim/plugins/vim-plug/plug.vim
025.972  001.078  001.078: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/ftoff.vim
047.317  020.726  020.726: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/filetype.vim
047.551  000.024  000.024: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/ftplugin.vim
047.709  000.017  000.017: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/indent.vim
047.817  046.295  002.276: sourcing min.vim
047.832  000.152: sourcing vimrc file(s)
048.233  000.235  000.235: sourcing /data/roxma/test/starttime/nvim-completion-manager/plugin/cm.vim
049.089  000.292  000.292: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/gzip.vim
049.155  000.019  000.019: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/health.vim
049.271  000.073  000.073: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/man.vim
050.221  000.912  000.912: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/matchit.vim
050.590  000.321  000.321: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/matchparen.vim
051.495  000.860  000.860: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/netrwPlugin.vim
051.668  000.085  000.085: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/rplugin.vim
051.741  000.022  000.022: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/rrhelper.vim
051.936  000.150  000.150: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/shada.vim
052.046  000.045  000.045: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/spellfile.vim
052.329  000.234  000.234: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/tarPlugin.vim
052.574  000.180  000.180: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/tohtml.vim
052.670  000.036  000.036: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/tutor.vim
052.961  000.238  000.238: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/vimballPlugin.vim
053.326  000.293  000.293: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/zipPlugin.vim
053.456  001.630: loading plugins
053.967  000.511: loading packages
053.991  000.024: inits 3
062.491  008.500: reading ShaDa
063.561  001.070: clearing screen
064.691  000.494  000.494: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/autoload/remote/host.vim
065.879  000.393  000.393: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/autoload/remote/define.vim
069.866  004.848  004.454: sourcing /data/roxma/.local/share/nvim/rplugin.vim
071.026  000.987  000.987: sourcing /data/roxma/test/starttime/nvim-completion-manager/autoload/cm.vim
084.018  014.128: opening buffers
084.130  000.112: BufEnter autocommands
084.140  000.010: editing files in windows
084.295  000.155: VimEnter autocommands
084.298  000.003: before starting main loop
084.826  000.122  000.122: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/autoload/provider/pythonx.vim
174.745  089.811  089.811: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/autoload/provider/python3.vim
499.881  325.650: first screen update
499.898  000.017: --- NVIM STARTED ---

after


times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.016  000.016: --- NVIM STARTING ---
000.314  000.298: locale set
000.934  000.620: inits 1
000.947  000.012: window checked
001.183  000.236: parsing arguments
001.186  000.003: expanding arguments
001.249  000.063: inits 2
001.372  000.123: init highlight
001.969  000.252  000.252: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/syntax/syncolor.vim
002.142  000.512  000.259: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/syntax/synload.vim
017.568  015.348  015.348: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/filetype.vim
017.652  016.121  000.261: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/syntax/syntax.vim
017.741  000.012  000.012: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/filetype.vim
017.895  000.065  000.065: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/ftplugin.vim
018.035  000.039  000.039: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/indent.vim
019.839  001.738  001.738: sourcing /data/roxma/.local_software/neovim/plugins/vim-plug/plug.vim
021.124  000.868  000.868: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/ftoff.vim
042.031  020.477  020.477: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/filetype.vim
042.165  000.013  000.013: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/ftplugin.vim
042.259  000.009  000.009: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/indent.vim
042.327  040.851  001.509: sourcing min.vim
042.334  000.112: sourcing vimrc file(s)
042.579  000.128  000.128: sourcing /data/roxma/test/starttime/nvim-completion-manager/plugin/cm.vim
043.095  000.168  000.168: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/gzip.vim
043.136  000.012  000.012: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/health.vim
043.209  000.053  000.053: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/man.vim
043.808  000.567  000.567: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/matchit.vim
044.039  000.192  000.192: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/matchparen.vim
044.565  000.495  000.495: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/netrwPlugin.vim
044.670  000.060  000.060: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/rplugin.vim
044.716  000.014  000.014: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/rrhelper.vim
044.859  000.117  000.117: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/shada.vim
044.954  000.040  000.040: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/spellfile.vim
045.138  000.150  000.150: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/tarPlugin.vim
045.272  000.094  000.094: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/tohtml.vim
045.326  000.021  000.021: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/tutor.vim
045.541  000.170  000.170: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/vimballPlugin.vim
045.778  000.188  000.188: sourcing /data/roxma/.local_software/neovim/share/nvim/runtime/plugin/zipPlugin.vim
045.869  001.066: loading plugins
046.066  000.197: loading packages
046.086  000.020: inits 3
051.680  005.594: reading ShaDa
052.475  000.795: clearing screen
053.823  000.907  000.907: sourcing /data/roxma/test/starttime/nvim-completion-manager/autoload/cm.vim
065.748  012.366: opening buffers
065.853  000.105: BufEnter autocommands
065.864  000.011: editing files in windows
066.007  000.143: VimEnter autocommands
066.012  000.005: before starting main loop
069.343  003.332: first screen update
069.352  000.009: --- NVIM STARTED ---

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

@fannheyward

Try the newest version I just pushed. The total startuptime is very small with minimal vimrc.

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

Posted an issue to neovim neovim/neovim#6239

from nvim-completion-manager.

fannheyward avatar fannheyward commented on June 3, 2024

It works! The startuptime reduced from 600 to 130. Thanks for your work!

from nvim-completion-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.