Question

Why rangy becomes more sluggish when the number of annotations made ​​with function highlighter.highlightSelection (marktype) is growing? Performance is very good at first but this decreases as they grow annotations.

so,How could I do to improve the performance of the function highlighter.highlightSelection()? because when I were selected many different parts of my html the performance worsens exponentially. if you select a fragment of html very long the performance is going to be worst. I tried to fix this but i had not known how.

Anyone know why this might happen?

Was it helpful?

Solution

Performance degrades because Rangy has to remove and recreate all existing highlights whenever a new highlight is created. This inefficiency is one reason why the highlighter module has never been included as an official Rangy module.

I'm working on a different, character offset-based approach that may improve performance, so there is hope.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top