You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tested an implementation where I replaced the hashmap with btreemap. (https://github.com/godofdream/ramhorns/tree/btreemap)
It seems that in most cases the btreemap is faster on my machine (AMD Ryzen 5 3600 6-Core Processor).
Theoretically also the ramusage should be smaller.
The performance gain you have is not from replacing HashMap with BTreeMap, it's from removing the hash from a Field and forcing string compares everywhere. Why exactly is that faster isn't perfectly clear to me, but it's probably just leaving an extra register free.
The benchmarks won't reflect it since they only use two fiends and the names have different lengths, but this will be a performance degradation one you have more fields, and especially when you have two or more fields with names of the same length. I've explained the purpose of the hash in a blog post.
I have tested an implementation where I replaced the hashmap with btreemap. (https://github.com/godofdream/ramhorns/tree/btreemap)
It seems that in most cases the btreemap is faster on my machine (AMD Ryzen 5 3600 6-Core Processor).
Theoretically also the ramusage should be smaller.
Would it make sense to make the btreemap/hashmap switchable by feature?
The text was updated successfully, but these errors were encountered: