Dynamic array vs Gap buffer: performance analysis for immediate mode UI
Gap buffer is one of the most common data structures used for editing text, while a dynamic array is the simplest data structure for manipulating a sequence of elements of arbitrary size. What is the most optimal choice for an application that not only does text editing, but redraws the entire line on every key press? In this article, we'll find out.