Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Improve performance of opening files - #6777

Merged
maxbrunsfeld merged 3 commits into
masterfrom
mb-open-files-faster
May 14, 2015
Merged

maxbrunsfeld merged 3 commits into
masterfrom
mb-open-files-faster

Conversation

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Currently, opening large files takes a long time. Most of the time is spent tokenizing the lines and computing the screen lines (accounting for soft-wraps, etc). Because of a small logic error, this was all happening twice, every time we opened a file.

These flame graphs are for opening an example 2.3MB javascript file (jQuery 2.0.3, concatenated 10 times).

Before

Opening the file took about 8.2 seconds. The span of time between the two red arrows is unnecessary work.

screen shot 2015-05-13 at 8 18 58 pm

After

No more duplicated work. Opening the file took about 3.2 seconds.

screen shot 2015-05-13 at 8 17 45 pm

Previously, instantiating a TextEditor would always compute compute
screen lines twice: once when the DisplayBuffer was instantiated,
and once when the 'invisibles' property was set on the DisplayBuffer.
maxbrunsfeld pushed a commit that referenced this pull request May 14, 2015
Improve performance of opening files
@maxbrunsfeld
maxbrunsfeld merged commit 8c61a6b into master May 14, 2015
@maxbrunsfeld
maxbrunsfeld deleted the mb-open-files-faster branch May 14, 2015 04:38
@thomasjo

Copy link
Copy Markdown
Contributor

😎🤘

@kevinsawicki

Copy link
Copy Markdown
Contributor

So awesome 👍

@benogle

benogle commented May 14, 2015

Copy link
Copy Markdown
Contributor

wowowowow o_O

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.

4 participants