Re:Data Structures in the Fleet Editor
by searealist on Tuesday February 22, 2022 @03:26AM
(#30425337)
I'm just saying that "gap buffer" is not a reason any editor is perceived to be slow unless its slow when moving the cursor in a large buffer (or as you point out, the amortized growth of a large buffer, which will happen max log n times in a buffer of size n)
[ Parent
| on HN ]
Re:Data Structures in the Fleet Editor
by moonchild on Tuesday February 22, 2022 @05:51PM
(#30435003)
> amortized growth of a large buffer, which will happen max log n times in a buffer of size n
You can do better than log if you care to; just grow the buffer more quickly. It's just that exponential growth tends to work pretty well (and, notably, amortizes the overhead of copying such that it is O(1)). Also: people tend to take breaks when typing, so you can asynchronously try to grow the buffer when it is close to full.