News for hackers. Stuff that matters.
Re:Text Showdown: Gap Buffers vs. Ropes by IshKebab on Monday October 09, 2023 @02:22PM (#37823476)
> Text is really small

Tell that to my 10GB JSON files.

Re:Text Showdown: Gap Buffers vs. Ropes by pphysch on Monday October 09, 2023 @03:30PM (#37824348)
You're opening those in a text editor?
Re:Text Showdown: Gap Buffers vs. Ropes by mananaysiempre on Monday October 09, 2023 @06:32PM (#37826282)
Absolutely, although sometimes I have to resort to less(1) when everything else crashes and burns on them. The advanced troubleshooting technique known as “look” is as useful as ever.
Re:Text Showdown: Gap Buffers vs. Ropes by eviks on Tuesday October 10, 2023 @04:36AM (#37829751)
Why not use the common tool for some quick lookup?
Re:Text Showdown: Gap Buffers vs. Ropes by josephg on Monday October 09, 2023 @06:42PM (#37826361)
That doesn’t sound like a text file. Sounds like you have the world’s least convenient database.

You’re on your own with that one. Sounds like a job for SQLite, not a rope library.

Re:Text Showdown: Gap Buffers vs. Ropes by roland35 on Monday October 09, 2023 @07:41PM (#37826860)
[delayed]
Re:Text Showdown: Gap Buffers vs. Ropes by KerrAvon on Monday October 09, 2023 @06:49PM (#37826433)
Dude. TFA is literally about the core data structures for a text editor. Many people care about large text files. It's something people actually do. BBEdit on the Mac can edit files much larger than RAM without thrashing. If you don't want to support text editors, that's fine, but then what is your rope library for?
Re:Text Showdown: Gap Buffers vs. Ropes by josephg on Monday October 09, 2023 @07:00PM (#37826525)
Good question. I wrote it to support my work on highly efficient text CRDTs for collaborative editing. I wrote a blog post about it a few years ago, though this is out of date now since I’ve made so many new performance improvements:

https://josephg.com/blog/crdts-go-brrr/

Re:Text Showdown: Gap Buffers vs. Ropes by alpaca128 on Monday October 09, 2023 @07:19PM (#37826677)
I've reformatted 1GB files with a Vim macro in the past, weeks ago I processed 3-4GB JSON files, it's not that unusual nowadays if you work with a bit of data.

Though note that in many cases long lines are also important to consider - many editors struggle hard and become near unusable if the line on screen is e.g. 1MB long (which again isn't as uncommon as you'd think).

Re:Text Showdown: Gap Buffers vs. Ropes by eviks on Tuesday October 10, 2023 @04:34AM (#37829742)
Indeed. Do you know which editors don't blink working with a 1gb-1line json file?
Re:Text Showdown: Gap Buffers vs. Ropes by kaba0 on Wednesday October 11, 2023 @09:53AM (#37844411)
Arguably, different algorithm could be used for that and for “normally” occurring files.