mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
9372ca60ad
The way it operated was evil. It did a depth-first search from the root, finding the node using reference equality. For documents with deep structures, this could take a long time. Inez did some profiling and found it was called tens of millions of times on a complex document. Kill getOffsetFromNode() and move its functionality to getOffset(). The logic has been completely rewritten: getOffset() now traverses up from the node rather than down from the root, and pretty much does the reverse of what getNodeFromOffset() does. This should be much more efficient even without offset caching in the node objects (which we may still implement later). Change-Id: I125f9fa423c40db6472e2c4a7c94214218ba3bc7 |
||
---|---|---|
.. | ||
lineardata | ||
nodes | ||
ve.dm.AnnotationSet.test.js | ||
ve.dm.BranchNode.test.js | ||
ve.dm.Converter.test.js | ||
ve.dm.Document.test.js | ||
ve.dm.DocumentSynchronizer.test.js | ||
ve.dm.example.js | ||
ve.dm.IndexValueStore.test.js | ||
ve.dm.LeafNode.test.js | ||
ve.dm.LinearData.test.js | ||
ve.dm.MetaList.test.js | ||
ve.dm.Model.test.js | ||
ve.dm.ModelRegistry.test.js | ||
ve.dm.Node.test.js | ||
ve.dm.NodeFactory.test.js | ||
ve.dm.Surface.test.js | ||
ve.dm.SurfaceFragment.test.js | ||
ve.dm.Transaction.test.js | ||
ve.dm.TransactionProcessor.test.js |