Closed ronag closed 4 weeks ago
@lemire thoughts?
Can we beat it with native bindings?
The benchmarks should include in the cost of hashing the strings, shouldn't then? It is interesting that your get
benchmark is only 3.44x slower, considering that it is a sequential search.
How is Map implemented currently?
The benchmarks should include in the cost of hashing the strings, shouldn't then? It is interesting that your
get
benchmark is only 3.44x slower, considering that it is a sequential search.
Just trying to give javascript implementation every advantage.
How is Map implemented currently?
Probably some kind of hash table with open addressing.
A bit of a challenge for those interested. Is it possible to do a javascript/wasm/native implementation of
Map
that supportsBuffer
keys and is faster thanMap
+Buffer.toString
.Here is my initial failing experiment:
Note how I even try to give an advantage to
BufferMap
by moving the overhead of hashing outside of the benchmark.