Just did some benchmarking on data structures in Rust and was surprised to see that SkipList is slower than Vector and HashMap for search operations!
Insertion times are pretty good, but searching is where the SkipList falls behind.
If you're curious about this too, check out my little demo project: https://github.com/sh4ka/skiplist-demo
It's a simple benchmarking program that inserts 1 million elements and then searches for one of them.
#Rustlang #DataStructures #SkipList #Vector #HashMap #Programming
GitHub - sh4ka/skiplist-demo: Rust benchmark comparing `SkipList` vs `Vec` (binary search) vs `HashMap`. Results: `SkipList` (O(log N)) significantly slower for pure search due to scattered memory and poor cache locality. `Vec` excels with cache efficiency; `HashMap` offers fast O(1) search. Choose structure based on real workloads and memory/cache considerations.
Rust benchmark comparing `SkipList` vs `Vec` (binary search) vs `HashMap`. Results: `SkipList` (O(log N)) significantly slower for pure search due to scattered memory and poor cache locality. `Vec`...