The piece table is the unsung hero data-structure that is responsible for much of the functionality and performance characteristics we’ve come to e...
For further actions, you may consider blocking this person and/or reporting abuse
This is a great article. It reminds me a little of the "Delta" structure used by QuillJS. The document itself is represented as an array of objects, but updates are represented atomically as new objects of type
retain
,insert
, ordelete
. I don't think it offers the same performance advantages as a true piece table, but it does provide some flexibility about how you build the document and respond to changes.Thanks Isaac :)
Great post. I had never heard of this data structure until now. It makes a lot of sense how it could be implemented to build a text editor and would be much more performant than storing things in an array. It is also great to see the kinds of things used to build the tools many use to build tools that many others will use. Thanks for writing this!
Thanks very much!
Very well written article. Thanks for introducing us to a new data structure.
Thanks 🙂
Wow, this data structure is amazing! And the post does justice to it, well written and clear. Thank you for that, Darren!
Thanks so much, Adam, I really appreciate the feedback!
Thanks for the enlightenment! Great article which gives you where to start looking to understand how text editors works internally.
Thank you so much! Really appreciate your feedback 🙂
Very accessible writeup, thank you, I was able to share this with many people.
Could you maybe make a follow up comparing and contrasting the Piece Table with the Rope data structure for text editing?
I'm really happy to hear you found it accessible, that was my main goal :)
Unfortunately, I've never studied or implemented a rope in the past so it would be difficult to give an informed view of how they compare. If I ever take the time to learn about ropes, I'll probably end up writing about them, though!
Thanks for sharing the post too.
Thank you very much! I didn't know about it!
Thank you!
Sir. do you have any idea of quilljs