Text Showdown: Gap Buffers vs. Ropes

The author has been working on a project to reimagine the C core of Emacs in Rust. As part of this project, the author explores different ways to represent the text of a buffer. While GNU Emacs uses a gap buffer, most popular editors today use piece tables or ropes. The author compares the performance of a gap buffer with rope implementations in terms of resizing, moving the gap, memory overhead, editing overhead, and searching. The results show that gap buffers are optimized for multiple cursors and have advantages in searching and memory usage, while ropes excel in non-local editing patterns.

https://coredumped.dev/2023/08/09/text-showdown-gap-buffers-vs-ropes/

To top