Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

[RFC] Defer vim-state.coffee loading#471

Closed
maxxk wants to merge 1 commit into
atom:masterfrom
maxxk:patch-1
Closed

[RFC] Defer vim-state.coffee loading#471
maxxk wants to merge 1 commit into
atom:masterfrom
maxxk:patch-1

Conversation

@maxxk
Copy link
Copy Markdown

@maxxk maxxk commented Dec 13, 2014

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.

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
@maxbrunsfeld
Copy link
Copy Markdown
Contributor

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.

bronson added a commit to bronson/vim-mode that referenced this pull request Jul 4, 2015
[RFC] Defer vim-state.coffee loading

Conflicts:
	lib/vim-mode.coffee
@bronson
Copy link
Copy Markdown
Contributor

bronson commented Jul 4, 2015

Things have gotten a fair bit faster since this PR was filed. I figured I'd run this test again...

Test

  • git clone bronson/vim-mode # (to get the rebased lazy loading branch)
  • apm link vim-mode

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.

  • git checkout lazy-loading; sleep 0.5; atom .
  • git checkout master; sleep 0.5; atom .

Results

Lazy Master
19ms 30ms
18ms 30ms
18ms 31ms

Stable and definitive: on my machine, this technique saves 10ms / ~30%.

Conclusion

18ms is worthy of a gold highlight-warning and 30ms is the red highlight-error. This PR might get vim-mode out of the doghouse it shares with status-bar.

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.

@maxbrunsfeld
Copy link
Copy Markdown
Contributor

Thanks @bronson. I think we'll need to use some different tactics for improving the package's load time. Closing this out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants