Message from JavaScript talks

June 2017

— For instance I am adding a forEach method, and the stock array has an "index" argument for that

— 

That argument as implemented in the stringset would be wildly inconsistent since it's really a list of multiple arrays

— 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

Message permanent page

— Ie every word longer than 12 would have it's index decrease by 1, so it cannot be based on iterative index

Message permanent page

— 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

}

Message permanent page

— And that offset would not relect any real structure, just order of insertion to mimic a real linear structure

Message permanent page