Message from JavaScript discussions
June 2017
— Hmm, maybe I can assign offsets to each string based on order of insertion... The problem is removing a word of, like, 12 length, would then "shift" the facade indexes for all longer words
Ie every word longer than 12 would have it's index decrease by 1, so it cannot be based on iterative index
— The end goal being to abstract the data structure in a way that you can treat it like a flat array
— With my perf test?
— I think so
— It adds about 1/5'th faster I think
— Meaning it can add 100,000 strings in 1/10'th of a second, over twice as fast as native
— I used the same test as you and also found that
— I think if I add index offsets that will complicate the data strcture and make it slower... to do so I'd have to store objects like this instead of raw strings:
{
string: "Hello",
offset: 24
}
— And that offset would not relect any real structure, just order of insertion to mimic a real linear structure
— The real structure is this:
[
65: [
5: [
"Asdfg"
]
]
]
— 65
being A
in UTF-16, 5
being the string length