-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Speed up Vim startup #98
Conversation
Oh, just forgot, the syntax of define options for
Since the
But before work on it, we should have more definitions about it. |
wow! 👍 |
will review it later today, or over the weekend! |
BTW, how do you measure performance increase with |
Hmm? not really understand your meaning :) What's " |
well,
|
OK, it's clear.
|
I see, thanks for details. |
Sorry, just forget to provide a way to notice existing users update their vundle configuration to add the command |
The performance issue was introduced in 55a5ef0.
Hey gmarik, after thinking on how to notice existing users use |
Oops, the new approach doesn't works exactly the same compare to the original way. The problem here is, now we update 'runtimepath' in a plugin script which will be loaded after execute So we have 2 options:
How do you think? |
Hey @rainux, so I looked into the code. Here are my thoughts:
my main concern is with the complexity that gets added to get startup time improvements. User has to tag scripts, and then manually BundleBind to get scripts loaded. For instance in my case i don't start Vim often because i'm using But if you do consider this is important feature to have we could make Vundle "API" so you can this working as plugin. Also i think you saw this #12 which is cool idea to play with. Please let me know what you think. |
Hey @gmarik, it looks like you miss-understand these patches. Logically they are two parts, patches before "Introduce BundleBind! command to speed up Vim startup" (include itself) are really fixing the performance issue. The issue is kind of regression/trade-off for keep bundles get loaded same as the declaration order. The only thing this part added is the new Also as I've mentioned in above comment, in most case we can call the The second part which implement manually bind slower bundles via tags is kind of "deep optimization of the Vim startup process", and it should be consider experimental due to the ugly syntax of tags definition. I pushed them because they also related to the "Speed up Vim startup" topic, and want to discuss here to work out a better "user interface". Actually the
At last I don't think a simple feature like this is worth to be made as plugin. IMHO The benefit of plugin is user can turn on/off it, developer can separate complex code. But this feature is just about 40 lines code added 22 lines code deleted about the core behavior, and it is "off" by default. If user don't touch their configuration, everything works as before. What's the point to make it a plugin? |
Ok, i'll give it another try then.
|
I just got another idea to improve this: If we force use a separated config file like mentioned in #56, then the The new usage should like:
In vundle#rc() function we can read configuration from a config file like ~/.vim/Vundlefile, parse all the config commands like |
I'd do it like this
For someone concerned with startup. I'd not modify default (slower but easier to setup) behaviour it's same thing but |
Yeah and separate config file makes lots of sense in this case... with Lazy |
@gmarik Yeah I also mentioned "BundleBind" is not a good/clear name and can be changed. Don't have interest to add yet another command, I think I'll give up this pull request and implement the separated config file in my fork. It still possible to provide backward compatibility in this approach, e.g. if there's no |
Yeah, agreed adding extra command isn't a clear move How about using special init function
|
Essentially there's no difference between "add more command" and "add another init function", users still need to understand it then use it correctly to make it work. Why not we provide one and only one simple approach to resolve the problem clearly? |
Because it changes nice, default behaviour? Was thinking that we don't even need special command for that. |
Sure no special command is necessary, for the "only one simple approach" I mean use a separated config file like "Vundlefile". |
It's very clear an O(2n - 1) algorithm introduced in 55a5ef0 is not a "nice behavior". I have never saw an O(2n - 1) algorithm be used at anywhere. |
Ok "nice behavior" isn't really a quality. |
Hi gmarik,
Here are some patches mainly focused on speed up Vim startup:
Fix performance issue introduced by 55a5ef0.
Although there are other ways to resolve this, I finally chose to introduce a new command
BundleBind!
. The benefit is not only easy to implement and has the best performance, but also make it easy to implement below features. However, the command name "BundleBind!" may not be a good choice and can be changed. I haven't chose "BundleLoad!" because it doesn't really load plugins when it get executed.Use a
bind
option to control whether bind a scripts bundle (thus it will be loaded by Vim in the later stage of startup) at Vim startup.This can be use on slower and rarely used scripts.
Manually bind and load those scripts not bound at Vim startup with
BundleBind!
.It accept tags as arguments which can be set by
Bundle
command.Please review and consider pull them :)