-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Nerdtree calls autoload functions on load which slows down vim startup time #276
Comments
+1, NERDtree adds ~50ms to my VIM astertup |
Same here, NERDtree adds about 50ms to my startup time as well. Thanks for the geat plugin btw ! |
I can't speak for the other maintainers, but I see this as a very low-priority feature request. I can appreciate the desire for efficiency. We can't get carried away, though! |
I agree. 50 ms is hardly worth the effort of reducing in a scripting language. |
@PhilRunninger @lifecrisis , I completely understand. 50ms is nothing in terms of productivity, I agree. |
@antoinemadec. Technically speaking, this is totally feasible. It would be a simple matter of performing an orderly migration of the NERDTree code into the However, the work would be time consuming and error prone (unless you could code a very accurate script to do it for you). Please keep in mind that we all do this for free! |
@lifecrisis once again, I completely understand ! |
It seems to me that it takes around 250ms on my computer. Might take even more on slower ones. Correct me if I'm wrong (I might be); here's nerd-tree specific output from
|
If you use the vim-plug plugin manager, you can significantly reduce Vim's startup time, by delaying the sourcing of plugin packages. By adding the
my startup time went from 149ms to 119ms. My machine is fast enough that it doesn't make a noticeable difference, but using this delaying technique on as many plugins as possible can make a difference for you. I don't know what difference it makes, if any, using Vim 8's packages vs. a plugin manager. |
Hi @PhilRunninger , thanks for the tip! The only issue is that I ended up not using NERDTree anymore. Cheers, |
I'm going to close this issue, since #851 seems to be the solution for it. Raise a new issue if necessary. |
@PhilRunninger thanks for the help! |
I've seen that bug as well. I never confirmed it, but I believe it comes down to Plug choosing to use the |
plugin/NERD_tree.vim calls several autoload functions: nerdtree#runningWindows, nerdtree#loadClassFiles, and nerdtree#postSourceActions.
Since these are called directly inside the plugin file, they'll be called on startup. This will cause nerdtree to slowdown vim startup time.
You may want to extract these files (and what they call) into another autoload file so a much smaller file is processed at runtime instead of all of autoload/nerdtree.vim.
Issue was created in response to an observation that nerdtree takes 30 ms to load.
The text was updated successfully, but these errors were encountered: