rangy icon indicating copy to clipboard operation
rangy copied to clipboard

TextRange.saveCharacterRanges is quite slow for very large documents

Open sg1705 opened this issue 10 years ago • 1 comments

I have a document that contains over a million characters. I am trying to save selection which is at the bottom of the document, and I found that saveCharacterRanges takes a really long time.

Most of the time is spent by CharacterIterator trying to find the starting position of the selection.

Is there a more efficient way to find this starting position?

Use case: I am trying to serialize characterRange and then deserialize it.

sg1705 avatar Jul 03 '15 16:07 sg1705

It can't be denied that the TextRange module scales badly. There is similar, faster but less sophisticated functionality built into Rangy's core: getBookmark() and moveToBookmark().

timdown avatar May 21 '16 16:05 timdown