Stable hashing of symbols of used as weak map keys is inefficient
Categories
(Core :: JavaScript: GC, task, P5)
Tracking
()
People
(Reporter: jonco, Unassigned)
References
Details
To allow symbols to be used as weakmap keys we extended weakmaps to allow JS values containing GC things as keys. (This uses GC thing pointer equality and not JS value semantics. )
Stable hashing is used for all GC thing pointers regardless of whether they can move. Symbols in particular are allocated in the atoms zone and can never move so this is wasteful for the one other GC thing kind we care about here. For symbols we can hash the raw pointer.
This feature isn't enabled by default yet so this is not high priority.
Comment 1•2 years ago
|
||
Symbols and atoms also contain a HashNumber. For atoms this was added at some point because there were some security issues when we hashed the pointer; I'm not sure if the same thing applies to symbols.
| Reporter | ||
Comment 2•11 months ago
|
||
We now use the Symbol's dedicated hash property since bug 1863391.
Description
•