On large documents (say 300 kB with multiple blocks) getBlocks() is called every time delete happens.
It forces syntax parsing of the whole document which can be slow. In my test document it would take > 300 ms. During that time the document is shown un-styled, meaning heynote markings would show for a while.
This was reported on my fork https://github.com/kjk/edna/issues/22 and I fixed it by rewriting getBlocks() to use string.indexOf(), which made it run under 2 ms.
On large documents (say 300 kB with multiple blocks)
getBlocks()
is called every time delete happens.It forces syntax parsing of the whole document which can be slow. In my test document it would take > 300 ms. During that time the document is shown un-styled, meaning heynote markings would show for a while.
This was reported on my fork https://github.com/kjk/edna/issues/22 and I fixed it by rewriting
getBlocks()
to usestring.indexOf()
, which made it run under 2 ms.The commit is https://github.com/kjk/edna/commit/701dda8e09a083b1df8b8a2d343b511101f9d19a, feel free to take this code or disregard.