A question raised during yesterday's plenary was if the creation of Composite's should eagerly intern/canonicalize, such that Composite({ x: 1 }) === Composite({ x:1 })
.
Upsides:
Downsides:
Symbol.iterator
could not be a key-0
is canonicalized to 0
.Weak{Map,Set}
Composite({ x: 1, y: 4 })
has no constituents that provide a non-infinite lifetimeWeakMap
where Composite({ a: objectA, b: objectB, c: 42 })
is a key should remain in the WeakMap
until either objectA
or objectB
becomes unreachable - this applies deeply for composites made from other composites.Tuple.prototype
to provide Symbol.iterator
and list methods such as .map
, .some
for these to still be equal across realms they would need to have a realm scoped [[prototype]]
lookup similar to primitives and the one being discussed for Shared Structs.Important
The quantity of the above lists should not be interpreted as weights on different sides of a scale. 10 downsides could still be trumped by 1 upside.
One good next step here IMO is to get some empirical data from a prototype implementation to measure some of performance impacts of different designs with different application use cases. Maybe this will be a good time for me to learn how to build v8 and get a custom binary on to some mobile phones!
cc: @syg
qwertie, Maxdamantus, Ovyerus, SeregPie and nnmrtsslorber, travislwatson, controversial, tusharsadhwani, AleksandrSl and 1 moreMaxdamantus, slorber, transitive-bullshit, petamoriken, pickaxe828 and 2 more
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4