Swap Dict implementation to ankerl dense unordered

ankerl::dense_unordered is a very fast hash map that is built to be an index map.
This enables extra optimizations compared to just wrapping a regular hash map.
As such, I think this map is very well suited for our index map impl in Roc.
I also think this dictionary implementation is simpler overall.
On top of that, this removes the need for SIMD instructions for peak performance.

Benchmarks of the C++ version and other C++ hash maps are here: https://martin.ankerl.com/2022/08/27/hashmap-bench-01/
Though this has clear bias of being written by the author of ankerl::dense_unordered,
the results all look correct and the benchmarks thorough.
This commit is contained in:
Brendan Hansknecht 2023-12-06 21:06:44 -08:00
parent eadd0e82ce
commit 51ec4311b5
No known key found for this signature in database
GPG key ID: A199D0660F95F948
3 changed files with 431 additions and 363 deletions

View file

@ -1486,6 +1486,7 @@ define_builtins! {
26 DICT_JOINMAP: "joinMap"
27 DICT_KEEP_IF: "keepIf"
28 DICT_DROP_IF: "dropIf"
29 DICT_RESERVE: "reserve"
}
9 SET: "Set" => {
0 SET_SET: "Set" exposed_type=true // the Set.Set type alias
@ -1510,6 +1511,8 @@ define_builtins! {
19 SET_JOIN_MAP: "joinMap"
20 SET_KEEP_IF: "keepIf"
21 SET_DROP_IF: "dropIf"
22 SET_WITH_CAPACITY: "withCapacity"
23 SET_RESERVE: "reserve"
}
10 BOX: "Box" => {
0 BOX_BOX_TYPE: "Box" exposed_apply_type=true // the Box.Box opaque type