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

Performance improvements for initial keystrokes in Find - #5303

Merged
gruehle merged 2 commits into
masterfrom
pflynn/find-highlight-perf
Sep 26, 2013
Merged

gruehle merged 2 commits into
masterfrom
pflynn/find-highlight-perf

Conversation

@peterflynn

Copy link
Copy Markdown
Member

Performance improvements for Find, focused on the initial keystroke or two (when the number of results is usually very high):

  • Batch tickmark creation (saves 120ms in med-size files like FindReplace)
  • Turn off tickmark & inline highlighting when tons of search results found (saves 1+ sec in huge files like codemirror.js). We still search the full text, but that's the fast part -- it's just the per-result DOM updates that were slow.

The timing tests I ran involved typing the letter "a" in the Find field in files of varying sizes. I think in typical files we'll save 50-150 ms, which should be quite noticeable. In huge files like codemirror.js the improvement will be much more dramatic.

…r two

when the number of results is usually very high:
- Batch tickmark creation (saves 120ms in med-size files like FindReplace)
- Cut off tickmark & inline highlighting when tons of search results found
(saves ~1 sec in huge files like codemirror.js)
@ghost ghost assigned gruehle Sep 24, 2013
Comment thread src/search/ScrollTrackMarkers.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this function be removed? It isn't called by anyone, and it could encourage people to write poorly performing code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, you're right -- there's no good reason to encourage adding tickmarks one at a time

@gruehle

gruehle commented Sep 25, 2013

Copy link
Copy Markdown
Member

Initial review complete. Performance is MUCH better in large documents. I just had one question and one nit.

@peterflynn

Copy link
Copy Markdown
Member Author

@gruehle Changes pushed!

@gruehle

gruehle commented Sep 26, 2013

Copy link
Copy Markdown
Member

Looks good! Merging.

gruehle added a commit that referenced this pull request Sep 26, 2013
Performance improvements for initial keystrokes in Find
@gruehle
gruehle merged commit 8e79f54 into master Sep 26, 2013
@gruehle
gruehle deleted the pflynn/find-highlight-perf branch September 26, 2013 16:49
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