Avoid forcing computation of all screen lines when opening a file #12898

Merged
merged 12 commits into from Oct 14, 2016

Conversation

Projects
None yet
3 participants
@maxbrunsfeld
Contributor

maxbrunsfeld commented Oct 6, 2016

When opening a large file, the majority of time before the file appears on screen is spent building the DisplayLayer's index of screen coordinates to buffer coordinates. As of atom/text-buffer#175, the DisplayLayer can now compute this information lazily. This PR adjusts our usage of the display layer so that when possible, we avoid indexing the entire buffer.

Benchmarks

Before (v1.12-beta0)

On my machine, opening a 10MB file used to take over 5 seconds:

opening-before

Once the file was on screen, there was a long period in which the application was unresponsive because of work being done in the autocomplete-plus package. This was partially addressed in atom/autocomplete-plus#782, which disables symbol indexing for large files. The following graph only goes up to 6MB because for files larger than that, the editor crashed 馃槵 .

before-event-loop

After

Opening a file:

Now, when opening a 10MB file, it appears on screen in two seconds second:

after-opening

The application remains responsive afterwards:

after-event-loop

@as-cii

This comment has been minimized.

Show comment
Hide comment
@as-cii

as-cii Oct 14, 2016

Member

Looks good after merging the pull request on text-buffer! 馃憤

Member

as-cii commented Oct 14, 2016

Looks good after merging the pull request on text-buffer! 馃憤

@maxbrunsfeld maxbrunsfeld merged commit b946e34 into master Oct 14, 2016

0 of 5 checks passed

ci/circleci CircleCI is running your tests
Details
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@maxbrunsfeld maxbrunsfeld deleted the mb-defer-work-when-opening-files branch Oct 14, 2016

@none-da

This comment has been minimized.

Show comment
Hide comment

none-da commented Nov 22, 2016

馃憦

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