3 ms·
I believe I saw similar results comparing typed arrays vs simple objects with numerical keys when doing this refactor[0] at least in V8. In my case case multipl
by mazirian 8y ago
I believe I saw similar results comparing typed arrays vs simple objects with numerical keys when doing this refactor[0] at least in V8. In my case case multiple child keys may match so I need to scan them instead of indexOf but otherwise it sounds similar. Also didn't see benefits from turning non-branching paths into arrays, maybe due to fairly shallow trees. I've also used a very simple trie implementation for public-suffix tree matching in my own extension[1] so interested in what the current best way to implement this sort of thing is in JS.
[0]https://github.com/yahoo/ycb/pull/54 https://github.com/yahoo/ycb/pull/54
[1]https://github.com/billdorn/cookiekiller https://github.com/billdorn/cookiekiller