[RFC] Defer vim-state.coffee loading#471
Conversation
I was wondering is it acceptable to defer vim-state.coffee loading until the first text editor is created? On my machine with this change vim-mode loading time goes from ~100ms down to ~15ms. On the other hand, this change will slow down first text editor opening a bit. Change was proposed by @lee-dohm in atom/atom#2654
|
In my opinion, since this won't help the common case of starting Atom with text editors open, it isn't worth lazy-loading in this case. I'm open to arguments in favor of doing it though. |
[RFC] Defer vim-state.coffee loading Conflicts: lib/vim-mode.coffee
|
Things have gotten a fair bit faster since this PR was filed. I figured I'd run this test again... Test
Now, to perform the test, I launched Atom, opened timecop, and recorded vim-mode's startup time. I ran the following commands alternately so each startup was very warm.
Results
Stable and definitive: on my machine, this technique saves 10ms / ~30%. Conclusion18ms is worthy of a gold That said, I agree with @maxbrunsfeld: every time I open my editor, I'm going straight into a Vim window. For me, all this patch does is reorder the load process. It doesn't actually save any real-world time. Doesn't seem worth it. |
|
Thanks @bronson. I think we'll need to use some different tactics for improving the package's load time. Closing this out. |
I was wondering is it acceptable to defer vim-state.coffee loading until the first text editor is created?
On my machine with this change vim-mode loading time goes from ~100ms down to ~15ms.
On the other hand, this change will slow down first text editor opening a bit.
Change was proposed by @lee-dohm in atom/atom#2654.