hughfdjackson / immutable

neatly packages immutable equivalents to JavaScript's Objects and Arrays.
101 stars 7 forks source link

Replace `path` parameters in hamt with `depth` param #15

Closed hughfdjackson closed 11 years ago

hughfdjackson commented 11 years ago

At the moment, a lot of copying and extra memory is consumed by keeping hold of the remaining path in the object*. It's perfectly possible to simple pass the depth, and derive the path from that, the key and the hashPath function (possibly memoized).

Try it out for possible perf boost, and implementation simplificaiton.

hughfdjackson commented 11 years ago

Done, but in persistent-hash-trie