interesting idea, although not obvious this would have the intended affect. E.g., consider a string search across 10 different string objects (thus 10 different backing arrays), vs a search across a single array. Much…
Briefly looking at the code: 1. data structures don't support efficient insertion/removal at arbitrary positions in the string 2. "replace" method is O(n) where n == length of the string 3. string searching inside…
use a gap buffer: https://en.wikipedia.org/wiki/Gap_buffer. For scaling large docs, you can do a linked list of gap buffers and avoid re-allocs of large buffers. Super simple, efficient enough for most “i wrote my own…
interesting idea, although not obvious this would have the intended affect. E.g., consider a string search across 10 different string objects (thus 10 different backing arrays), vs a search across a single array. Much…
Briefly looking at the code: 1. data structures don't support efficient insertion/removal at arbitrary positions in the string 2. "replace" method is O(n) where n == length of the string 3. string searching inside…
use a gap buffer: https://en.wikipedia.org/wiki/Gap_buffer. For scaling large docs, you can do a linked list of gap buffers and avoid re-allocs of large buffers. Super simple, efficient enough for most “i wrote my own…