Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Lower startup time - #219

Merged
kevinsawicki merged 64 commits into
masterfrom
ks-lower-startup-time
Sep 12, 2014
Merged

kevinsawicki merged 64 commits into
masterfrom
ks-lower-startup-time

Conversation

@kevinsawicki

Copy link
Copy Markdown
Contributor

Background

The tree view loads synchronously at startup and restores the previously expanded directories and scroll position. This can significantly impact startup performance since each entry in the tree is a space-pen view.

The goal of this PR is minimize the impact that the tree view has on startup by finding faster ways to create and renders the views.

What Changed

  • Custom Elements are now used instead of extending View which are quicker to create.
  • Minimize object creation by not using full blown File/Directory models from pathwatcher, instead just use lighter weight models that only load the needed file/folder information.
  • Use pure DOM APIs instead of jQuery
  • Use event-kit instead of emissary for subscribing to and emitting model events.

Results

Opened a project with 290 folders and 5 files that is scrolled all the way to the bottom with the bottom file selected and the view focused on a Macbook Pro on OS X 10.8.5 with 2.6 Ghz Intel Core i7 processors and 16 GB of memory.

Previous time take to create the view: 320ms

New time taken to create the view: 125ms

Closes #216

Comment thread lib/directory-view.coffee

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of sucks. Not very readable. We need a better story for creating markup.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, figured we would circle back with a markup/template push eventually once we refactor a couple more packages to use custom elements.

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

The specs are green against atom/atom master but are failing against 0.126 since atom/atom@c141448 is only on master and makes it so you can use the Jasmine matchers with a raw element.

So this won't get merged before atom 0.127 is released.

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

So this won't get merged before atom 0.127 is released.

0.127 is out now and the specs are now 📗 on CI, so I'm going to merge this and plan to include it with 0.128

kevinsawicki added a commit that referenced this pull request Sep 12, 2014
@kevinsawicki
kevinsawicki merged commit 9a4a79c into master Sep 12, 2014
@kevinsawicki
kevinsawicki deleted the ks-lower-startup-time branch September 12, 2014 00:34
kevinsawicki added a commit to atom/find-and-replace that referenced this pull request Sep 12, 2014
The tree view was updated in atom/tree-view#219 to not use space pen
views so update the search in directory command to pull the path directly
from the DOM element.
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.

Very high startup time for Tree View

3 participants