This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 tasks
maxbrunsfeld
force-pushed
the
mb-marker-index
branch
6 times, most recently
from
May 12, 2015 22:11
9be25b8
to
21919cf
Compare
Signed-off-by: Nathan Sobo <nathan@github.com>
maxbrunsfeld
force-pushed
the
mb-marker-index
branch
from
May 12, 2015 22:27
21919cf
to
576dbad
Compare
1 task
maxbrunsfeld
force-pushed
the
mb-marker-index
branch
2 times, most recently
from
May 13, 2015 05:28
73a166b
to
142ef28
Compare
maxbrunsfeld
force-pushed
the
mb-marker-index
branch
from
May 13, 2015 05:35
142ef28
to
e2d5232
Compare
maxbrunsfeld
pushed a commit
that referenced
this pull request
May 14, 2015
Use MarkerIndex from text-document
This was referenced Jun 10, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to speed up text editing operations (inserting, replacing and deleting text) in the presence of a large number of markers. Markers' locations are stored as relative offsets in a b-tree, which allows textual updates to be handled in logarithmic time relative to the number of markers.
Side note: This PR also comes with a rewritten
History
class. Transactions are now implemented in terms of checkpoints, which allows for transactions within transactions, and (more notably) undo/redo within transactions. Thus, this closes the elusive atom/atom#5723.Before
Currently, the
MarkerManager
objects maintain an interval-skip-list to support efficient lookups of markers by range. Updating this skip-list is expensive in the presence of large numbers of markers.This is the flame graph for typing a newline in the middle of jquery.js while searching for all
;
characters (2356 results):The time between the two red arrows is spent updating the skip-list. In this case, it took 54ms. The entire event took 147ms.
After
This is the flame graph for the same operation as above, with the new implementation. Note that it's not to scale with the graph above.
The time between the two red arrows is spend updating the B-Tree. It took 1.7ms. The entire event took 47ms.
What now
Typing is still not fast in the presence of huge numbers of search results. The next slowest component in the flame graph above is emitting marker change events. Some of this may be due to packages, not atom-core code. I'll be investigating this slowness further as part of atom/atom#6692.