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

Don't recompute symbols or fuzzy provider tokens when editor.largeFileMode is on - #782

Merged
as-cii merged 2 commits into
masterfrom
as-dont-recompute-symbols-for-large-files
Oct 14, 2016
Merged

as-cii merged 2 commits into
masterfrom
as-dont-recompute-symbols-for-large-files

Conversation

@as-cii

@as-cii as-cii commented Oct 12, 2016

Copy link
Copy Markdown
Contributor

After an editor has been created and its lines tokenized, we were previously scanning the entire buffer to search for symbols or fuzzy provider tokens. This operation could be quite expensive, and its cost grew linearly with the size of the file.

screen shot 2016-10-12 at 10 13 27

screen shot 2016-10-12 at 10 13 51

(Benchmark performed by opening big.txt, 5.2MB)

With this pull request, when largeFileMode is detected, we simply avoid scanning the buffer, which makes opening files larger than 2MB significantly faster. In the future, we might also improve this further for files smaller than 2MB by recomputing symbols or fuzzy provider tokens in chunks via request idle callbacks.

For now, in conjunction with atom/atom#12933, this should fix all the remaining large files performance bottlenecks that don't concern text-buffer.

/cc: @atom/core

@as-cii
as-cii force-pushed the as-dont-recompute-symbols-for-large-files branch from 93a9fe6 to 006de01 Compare October 12, 2016 09:35
@nathansobo

Copy link
Copy Markdown
Contributor

❤️ ⚡️ 🚢

@as-cii
as-cii merged commit af3b8e3 into master Oct 14, 2016
@as-cii
as-cii deleted the as-dont-recompute-symbols-for-large-files branch October 14, 2016 14:31
joefitzgerald added a commit that referenced this pull request Oct 14, 2016
joefitzgerald added a commit that referenced this pull request Oct 14, 2016
joefitzgerald added a commit that referenced this pull request Oct 17, 2016
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.

2 participants