-
Notifications
You must be signed in to change notification settings - Fork 73
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
clarification about lazy loading on keys #327
Comments
match-up is already using lazy loading, one problem is that it really does need to be loaded at buffer load since highlighting is a core feature. If you start it on % press, you'd miss the highlighting. Can you provide any startup time logs so I can see where the improvements might be? |
Sure, would you like me to run |
Yeah, I can work with the whole startuptime file, if you are able to share that. Ideally it would show the 300 ms is coming from to help me debug. For comparison the entire match-up load takes under 5ms on my computer |
Please find attached the startup logs P. S. I am using lazy.nvim as package manager and on start-up I see the below: which seems to be closer to the actual time I feel for start-up to take. P. P. S. I have now accidentally noticed (by using another computer where I don't run nightly) that such problem doesn't exist with |
Might explain why it works on my side BTW as another sanity check, what happens when you don't lazy load and instead load using normal methods,; vim-matchup has an autoload system already, maybe lazy.nvim is messing with that? |
The above numbers are obtained without any lazy loading, even removing the event |
This is not really a bug report, rather a request for clarification about loading start-up times.
environment
I have noticed that lately
vim-matchup
causes neovim to start very slowly, I am not sure exactly if due to latest commits on treesitter (vim-matchup using treesitter integration) or on this repository itself: I have tried to "binary debug" the commit history unsuccesfully. What I see is that vim-matchup itself requires a start-up time of around ~300ms, and I wonder if some sort of lazy loading can be achieved to delay its invocation till its usage: currently I am using lazy.nvim as package manager and my vim-matchup configuration is the below:usually lazy.nvim supports lazy loading on key presses, thus I tried to lazy load on
keys = {"%"}
(for the sake of the example, assuming we only want to use the%
motion), however it seems that doing so never loads the plugin at all (the startup times are vastly reduced, but the plugin does not load on key invocation).Since this is written in VimScript I was wondering if there is still some sort of autoload mechanism á la vim that makes loading on keys ineffective. What is your opinion about this, have you observed it yourself too by any chance and would you recommend some other types of lazy loading instead?
P. S. I should add that disabling the plugin does reduce the start-up time greatly.
The text was updated successfully, but these errors were encountered: