Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I believe it's one big linear buffer that gets resized as needed. The simplest solution, takes the least amount of space, and although it may seem quite inefficient to move essentially everything in the file after the character you insert, if you consider that a modern CPU can do memcpy()/memmove() at several GB per second, it doesn't seem like any delay should be perceptible. (I.e. any slowness is down to some other aspects of bad implementation.) Many of the old DOS text editors did the same, in a time when memory bandwidth was not much more than a few MB/s and files rarely over 1MB, and it worked well enough.

I've opened 200MB+ files in Notepad before, it depends entirely on processor speed.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: