ELI5. How is maphash different from just using map?
I am surely missing something. I thought the builtin map used hashing too?
I am surely missing something. I thought the builtin map used hashing too?
The maphash package in the standard library (hash/maphash) provides routines that hash string and []byte.
The builtin map type is a hash table.
I should get some sleep, thanks
The main difference is, it is an hardware accelerated & optimized compiler function, now exposed via the new maphash package in stdlib.
And it is fast. Faster than the former performance leader xxh3(avx2/avx512).
Try maphash yourself (example data dedupliction) https://news.ycombinator.com/item?id=34091206