-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
startup time very slow #191
Comments
Do you have information about how long your startup takes with any other plugin manager? If it's faster with others, then this is probably a I would suggest using https://github.com/dstein64/vim-startuptime to get a better breakdown of where the time during startup is spent, so that you can identify what's slowing you down. |
think you for you help, i use
total: and it is startup for 'dein',
the |
Cool, thanks for the information. That's quite a large difference. Would you mind posting your |
One thing I will note is that several plugin files (e.g. compe_snippets.vim, nvim-treesitter-text, etc.) appear only in the |
Oh, sorry - could you also post your |
sure, my dein config lazy plugin not same packer, but I feel that effect less ms. my dein config:
my
|
Thanks! I'll see if I can figure out what's taking so much time. If you get a chance to experiment, the one potentially big difference I noticed is that your Regardless, I'll try to clone your setup and do some more in-depth profiling once I get a chance (though this probably won't be too soon). Thanks again! |
OK,thinks,I agree you with Thanks for you help! |
It seems because I compile the config code. I change config
startup time drop to 63ms. thanks. it is not problem for me now |
Very strange. You did not alter the colorizer config code at all, except to change it from a module that returns a function to a module that directly runs the function's code? I would not expect there to be so large a performance difference between using |
I don't know, now I lazy load more plugins. |
I was also curious about this since I'd also noticed a drop in my startup time and done some profiling with plenary's profile module. I don't think it relates to packer tbh since I rewrote most of my config in lua and added quite a few new plugins, I tried moving my configs from plain requires to strings but don't see a consistent drop in startup time, I'd almost be glad if it was this since my current startup time is about |
Yeah, I have not found a significant difference in startup time between strings or I wonder if I should add an option to insert profiling code in |
fwiw, I currently get a startup time of about 60-65ms total, though I'm using relatively few plugins (44 at the moment) and have taken a lot of care to defer what I can to (mostly command-based) lazy loads. I also noticed that |
This would be very cool 😍 I really like to know when adding plugins what the cost of the plugin will be to my startup time i.e. should I lazy load it or not, do I need it if it's this costly time wise etc. Atm this feels a little obscured because most startup time plugins I don't think report lua plugin costs correctly or maybe just not in aggregate. Was actually just thinking of trying find a way locally to use |
tbh the actual number now isn't really a blocker at all it's more me being obsessive but I think a consistent way to know when you're sacrificing startup time and how much would be super useful just so you can make decisions about what to keep and how to load it. I tried to jerry rig something with |
Yeah, I made nvim-lua/wishlist#15 for this reason (though nobody's taken it up yet/I don't have time to do it myself right now.)
I think the easiest way to do this would be to insert |
Separately, I should at some point take a look through |
will checking the existence of an env var really cost that much? it could just be checked once at the beginning of the file, and only then does it do any evaluation. Although on the other hand profiling shouldn't be something that makes daily usage slower, tbh if a user is wanting to profile stuff they'd likely be fine doing a bit more work, but also I can think of it being a nice addition for packer to have some configurable option that reported plugin costs over a configurable threshold |
It's not so much the cost of checking for the env var as it is the cost of the extra function calls to record timing info. I've started an implementation in #221 that I think has potential, though - it makes the |
Just a suggestion, but there could be a parameter passed to |
Was just about to say something similar maybe if it turns out that it adds some expense (only if it's significant) there could be an option to prevent compiling the profiling logic in, but if it's a NOP then shouldn't cost anything significant so might be a premature optimisation 🤷🏿 |
@cloggier: Yup, that was the second alternative I proposed ("or instead only inserting this if you run a special "PackerCompile profile" command or something (which means more recompilation)") |
Hi @wbthomason, I have a similar problem in the startup time. As shown in figure above, Sourcing packer_compiled.vim take a very long time, and this is my https://gist.github.com/yech1990/41db0d1dc516102a5b36079078b8b73d Could you help me to solve this the problem? |
@yech1990 I think performance issues are very contextual, your load time looks like it's EDIT: Note that with packer a lot of the loading is shifted to the |
Thank you @akinsho, 42ms is fine, but when using the same configurations on a remote server. This number will make difference. |
@yech1990 sorry I don't think my point was entirely clear. I think it would be easer to debug if this issue is specific to packer if you provide more information on top of just what the startup time is most importantly what startup time do you see with other plugin managers. If the startup time is |
Thank you @akinsho. |
@yech1990: I will say that I don't see anything unusual in your |
nvim version:
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-69103ff/share/nvim"
Run :checkhealth for more info
problem: startup time exceed 200ms
sartup Info:
000.012 000.012: --- NVIM STARTING ---
001.267 001.255: locale set
002.086 000.820: inits 1
002.121 000.035: window checked
002.127 000.006: parsing arguments
002.474 000.346: expanding arguments
002.584 000.110: inits 2
003.270 000.686: init highlight
003.272 000.002: waiting for UI
006.208 002.936: done waiting for UI
006.270 000.062: initialized screen early for UI
051.492 045.222: sourcing vimrc file(s)
061.828 000.055 000.055: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-treesitter/ftdetect/query.vim
062.158 010.490 010.435: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/filetype.vim
063.040 000.061 000.061: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/ftplugin.vim
063.867 000.054 000.054: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/indent.vim
065.300 000.366 000.366: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/syntax/syncolor.vim
066.162 001.393 001.028: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/syntax/synload.vim
066.205 001.615 000.222: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/syntax/syntax.vim
073.756 001.052 001.052: sourcing /Users/yongqi/.config/nvim/plugin/bufkill.vim
073.971 000.122 000.122: sourcing /Users/yongqi/.config/nvim/plugin/difftools.vim
074.149 000.112 000.112: sourcing /Users/yongqi/.config/nvim/plugin/nicefold.vim
116.935 014.269 014.269: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/onebuddy/colors/onebuddy.vim
136.367 001.688 001.688: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/opt/nvim-treesitter-textobjects/plugin/nvim-treesitter-textobjects.vim
136.721 062.505 046.547: sourcing /Users/yongqi/.config/nvim/plugin/packer_compiled.vim
137.849 000.027 000.027: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/gzip.vim
137.945 000.021 000.021: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/health.vim
138.093 000.081 000.081: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/man.vim
138.185 000.021 000.021: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/matchit.vim
138.277 000.022 000.022: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/matchparen.vim
138.376 000.032 000.032: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/netrwPlugin.vim
138.695 000.017 000.017: sourcing /Users/yongqi/.local/share/nvim/rplugin.vim
138.705 000.261 000.244: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/rplugin.vim
138.899 000.121 000.121: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/shada.vim
139.020 000.037 000.037: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/spellfile.vim
139.126 000.026 000.026: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/tarPlugin.vim
139.223 000.021 000.021: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/tohtml.vim
139.332 000.029 000.029: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/tutor.vim
139.434 000.027 000.027: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/plugin/zipPlugin.vim
139.483 011.253: loading plugins
140.457 000.134 000.134: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/accelerated-jk/plugin/accelerated-jk.vim
142.090 001.306 001.306: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/asyncrun.vim/plugin/asyncrun.vim
143.565 001.208 001.208: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/asynctasks.vim/plugin/asynctasks.vim
148.432 000.233 000.233: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/vim-operator-user/autoload/operator/user.vim
156.389 012.118 011.885: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/caw.vim/plugin/caw.vim
157.374 000.366 000.366: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim/plugin/dashboard.vim
158.309 000.587 000.587: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/editorconfig-vim/plugin/editorconfig.vim
158.875 000.251 000.251: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/emmet-vim/plugin/emmet.vim
159.363 000.174 000.174: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/galaxyline.nvim/plugin/galaxyline.vim
159.854 000.133 000.133: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/lspsaga.nvim/plugin/lspsaga.vim
160.560 000.345 000.345: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/plugin/mkdp.vim
160.928 000.039 000.039: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-bufferline.lua/plugin/bufferline.vim
161.367 000.142 000.142: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/plugin/compe.vim
161.729 000.059 000.059: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-lspconfig/plugin/lspconfig.vim
162.170 000.144 000.144: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-tree.lua/plugin/tree.vim
163.552 001.008 001.008: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-treesitter/plugin/nvim-treesitter.vim
163.762 000.039 000.039: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-treesitter/ftdetect/query.vim
164.236 000.092 000.092: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-web-devicons/plugin/nvim-web-devicons.vim
169.858 005.058 005.058: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/plenary.nvim/plugin/plenary.vim
170.867 000.587 000.587: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/vim-closetag/plugin/closetag.vim
171.689 000.510 000.510: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/vim-eft/plugin/eft.vim
172.601 000.376 000.376: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/vim-operator-surround/plugin/operator/surround.vim
173.953 000.948 000.948: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/vim-terminal-help/plugin/terminal_help.vim
174.401 000.137 000.137: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/vista.vim/plugin/vista.vim
174.940 009.698: loading packages
177.170 001.488 001.488: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_buffer.vim
178.472 001.221 001.221: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_calc.vim
180.046 001.488 001.488: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_nvim_lsp.vim
181.327 001.198 001.198: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_nvim_lua.vim
181.792 000.148 000.148: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/autoload/compe.vim
182.150 000.118 000.118: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/autoload/compe_path/source.vim
182.568 000.139 000.139: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/autoload/compe/source/vim_bridge.vim
182.656 001.254 000.849: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_path.vim
186.614 003.877 003.877: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_snippets_nvim.vim
187.806 001.115 001.115: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_spell.vim
189.035 001.157 001.157: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_tags.vim
190.199 001.090 001.090: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_ultisnips.vim
190.301 000.033 000.033: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_vim_lsp.vim
191.497 001.097 001.097: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-compe/after/plugin/compe_vsnip.vim
191.824 001.866: loading after plugins
191.839 000.015: inits 3
198.934 007.096: reading ShaDa
199.222 000.056 000.056: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/nvim-treesitter/autoload/nvim_treesitter.vim
201.506 002.515: opening buffers
202.139 000.174 000.174: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim/autoload/dashboard.vim
205.381 003.701: BufEnter autocommands
205.386 000.005: editing files in windows
205.959 000.035 000.035: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim/autoload/dashboard/utils.vim
206.996 000.139 000.139: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim/autoload/dashboard/section.vim
208.530 000.276 000.276: sourcing /usr/local/Cellar/neovim/HEAD-69103ff/share/nvim/runtime/autoload/provider/clipboard.vim
214.602 000.296 000.296: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim/syntax/dashboard.vim
216.113 000.044 000.044: sourcing /Users/yongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim/syntax/dashboard.vim
219.859 013.683: VimEnter autocommands
219.864 000.006: UIEnter autocommands
219.870 000.005: before starting main loop
223.938 004.069: first screen update
223.942 000.003: --- NVIM STARTED ---
and my plugins config:
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.api.nvim_command("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
end
local packer = require("packer")
local use = packer.use
packer.init(
{
git = {
clone_timeout = nil
}
}
)
packer.reset()
-- return packer.startup(
-- function()
-- plugins manger
use "wbthomason/packer.nvim"
-- 标签页 状态栏
use "kyazdani42/nvim-web-devicons"
-- tab 栏插件 提供 leader + number 切换buffer
use {
"akinsho/nvim-bufferline.lua",
config = require("plugin-config.bufferline")
}
-- 状态栏插件
use {"glepnir/galaxyline.nvim", config = require("eviline")}
-- end
-- )
i'm a new vimer, if it a stupid question, i'm sorry for this. thinks
The text was updated successfully, but these errors were encountered: