Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mikeeeek
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
mikeeeek
7y ago
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 more likely for incr
2.
▲
by
mikeeeek
7y ago
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 ins
3.
▲
by
mikeeeek
7y ago
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