3 ms·
There's lots of comment here about how this isn't needed for "typical" editing of smallish files and you can get away with something very simple, but that isn't
by dkjaudyeqooe 3y ago
There's lots of comment here about how this isn't needed for "typical" editing of smallish files and you can get away with something very simple, but that isn't very interesting.
What is interesting is the opposite question: how do you enable editing that is bounded only by storage limits?
A piece table is a good solution for this since the original file and the added data is immutable, which lends itself to mmap-ing. Then you can implement the piece table and various indexes (line breaks, etc) in a database (such as SQLite) or similar. Overall this gives you consistent performance at any size or number of edits limited only by storage.
- kragen 3y agothe original file isn't immutable unless you have reflinks or equivalent