Open
Description
As per the README
Astute readers may object that some bookkeeping data remains in memory when you create tuple objects with prefixes of primitive values
This can be solved by 'hoisting' the object parts of the key to the front before performing the lookup. i.e.:
Tuple(1, 2, Object);
Tuple(1, Object, 2);
can interally lookup the tuples for:
[Object, 1, 2, Object]
[Object, 1, Object, 2]
This does make the lookup O(2n)
, but that is still O(n)
.
Note: this also doesn't only apply to objects, now that https://github.com/tc39/proposal-symbols-as-weakmap-keys is part of the spec, non-registered symbols can also be 'hoisted' to the start of the key too.
Metadata
Metadata
Assignees
Labels
No labels