News for hackers. Stuff that matters.
Re:Text Showdown: Gap Buffers vs. Ropes by chongli on Monday October 09, 2023 @12:49PM (#37822355)
Yeah. 20ms is more than a full frame at 60hz. This sort of delay is unacceptable in 3D games! And here we’re talking about inserting a character into the data structure used to keep track of edits to a text file!

It’s also ignorant of the heavily pipelined nature of input and output on modern computers. If you add up all of the latency from the time you press a key on the keyboard to the time a character appears on the screen — even if you subtract all the time spent inside your text editor — it adds up to many ms of delay. Now the author thinks it’s okay to add another 20-100ms to that just for the basic data structure holding the text? No thank you!

Edit: I have to add this link to a classic post by Dan Luu [1]. The Apple IIe leads the pack with 30ms latency from keystroke down to character on the screen. 20ms for a data structure (in the key-to-screen critical path) on a 2023 computer, even if it only occurs 1% of the time, is totally unacceptable.

[1] https://danluu.com/input-lag/

Re:Text Showdown: Gap Buffers vs. Ropes by _a_a_a_ on Monday October 09, 2023 @01:34PM (#37822965)
I thought your first para was sarcasm. Now I'm just not sure. It sits on the razor's edge, ready to fall either way in my mind.

NB. Elite running on Emacs https://www.salkosuo.net/2015/10/22/elite-for-emacs.html

Re:Text Showdown: Gap Buffers vs. Ropes by intelVISA on Monday October 09, 2023 @04:27PM (#37825084)
The true end goal of all posts here, such craftsmanship.
Re:Text Showdown: Gap Buffers vs. Ropes by codetrotter on Monday October 09, 2023 @10:09PM (#37827820)
To be sarcastic is human, but to be on the razor's edge is divine
Re:Text Showdown: Gap Buffers vs. Ropes by jenadine on Tuesday October 10, 2023 @01:31AM (#37828818)
> And here we’re talking about inserting a character

We are talking about the worst case when the buffer needs to be resized. This is not for every character. Just once in a while while editing very large texts.

Not that it makes it acceptable. But also not as bad as what you're making it sound.

Re:Text Showdown: Gap Buffers vs. Ropes by HerculePoirot on Tuesday October 10, 2023 @09:07AM (#37831570)
Yeah, I'd have dismissed your comment before I tried running a scheme repl on a raspberry pi over ssh (local) vs a clojure repl running on the jvm on my machine. Day and night.
Re:Text Showdown: Gap Buffers vs. Ropes by kaba0 on Wednesday October 11, 2023 @02:23AM (#37841556)
Maybe reread the relevant part of the article. It’s not average case at all.