5 ms·
> I don't think primitive data structures like a gap buffer are useful anymore. They come from a time where saving on memory was more important than it is now.
by teddyh 10y ago
> I don't think primitive data structures like a gap buffer are useful anymore. They come from a time where saving on memory was more important than it is now.
I beg to differ. I routinely open multi-gigabyte log files and SQL dumps in text format, and would not like to have to resort to “sed” to edit them.
- AlexanderDhoore 10y agoI don't disagree. Although a good rope implementation can handle that. Ropes are nice because it doesn't matter where you edit. Gap buffers have to copy around a lot of data if you are editing in different places. Btw the memory overhead is not that much. It's just the memory needed to keep the pointers between the nodes. So I'm talking 10% increase or something.