Open
Description
We have another instruction that is added to v8 for our performance experiments:
string.hash(str: string) -> int32
, opcode0xfbaa
- returns an implementation defined 32 bit hash value
The reasoning for this instruction is that any JavaScript engine already requires hashed strings, so with stringref
s there is already space reserved in the object for it and there are fast engine-internal implementations available handling different kinds of internal string representations etc.
Most languages require hashes for data structures and with stringrefs they can't add a hash property to strings, so keeping an application-defined hash together with the string is difficult / impacts performance.
Metadata
Metadata
Assignees
Labels
No labels