Re:Show HN: A retro terminal text editor for GNU/Linux coded...
by HexDecOctBin on Saturday August 31, 2024 @11:18PM
(#41413988)
No, it won't. You might want an arena for other reasons (better reasoning about lifetimes, preventing nest of pointers, etc.), but an array of line array approach to text editors is totally valid (except in the case of millions of extremely small lines).
[ Parent
| on HN ]
Re:Show HN: A retro terminal text editor for GNU/Linux coded...
by lanstin on Sunday September 01, 2024 @11:07AM
(#41417561)
I do from time to time open files of millions of small lines. To this day vim handles it better than emacs. These would be log files.
Re:Show HN: A retro terminal text editor for GNU/Linux coded...
by HexDecOctBin on Monday September 02, 2024 @09:16PM
(#41430254)
Log files have lines that are long enough, I was thinking more of one/two-character long lines (such that the overhead of malloc bookkeeping would be more than the line size in memory).
Regardless, Emacs also stores the data in a single array with a gap in middle (and memcpy is relatively cheap), so what slows it down is probably not the choice of data structure but everything else built around it.