News for hackers. Stuff that matters.
Re:Text Showdown: Gap Buffers vs. Ropes by gumby on Monday October 09, 2023 @01:15PM (#37822710)
In a modern OS, you can combine the gap and the piece table approaches using the MMU to eliminate most copying in the common cases.

Basically: if you need to make a gap, split the page it’s on into two (so your region copy is always less than one page long). You can start the copy into the middle of second page or not (I don’t actually think that’s an optimization in practice but have never measured it).

If you get a lot of fragmentation you can have a background process that does coalescence away from the active insertion point.

Re:Text Showdown: Gap Buffers vs. Ropes by kammerdiener on Tuesday October 10, 2023 @08:20AM (#37831137)
Do you have any more info on this?
Re:Text Showdown: Gap Buffers vs. Ropes by gumby on Tuesday October 10, 2023 @09:18AM (#37831678)
I thought my comment was pretty comprehensive on the technique. Is there something that was unclear? I can clarify.

I’ve used this technique a few times over the decades in non-editor applications with large sorted vectors.

Re:Text Showdown: Gap Buffers vs. Ropes by PH95VuimJjqBqy on Tuesday October 10, 2023 @10:05AM (#37832268)
Not only was it clear but it's the approach that popped into my head immediately while reading the article.
Re:Text Showdown: Gap Buffers vs. Ropes by kammerdiener on Tuesday October 10, 2023 @06:05PM (#37838262)
Your explanation was just fine. I was simply asking what else you knew about the technique. Perhaps where you first heard of it or some examples where it has been applied/benchmarked.