3 ms·
I know some of the core algorithms used by GNU's implementation (libstdc++). But what the Rust team could do is compare the performance of different implementat
by amelius 10y ago
I know some of the core algorithms used by GNU's implementation (libstdc++). But what the Rust team could do is compare the performance of different implementations, and pick the best one for each data structure.
- KMag 10y ago... which they have done, for some definition of "best". They've chosen an implementation with good cache locality and lower memory overhead (and presumably better average-case speed) than the chaining implementation usually used for std::unordered_map. The downside is that its worst-case speed is pretty bad. On the other hand, I believe they use Siphash by default, which means it's very difficult to even intentionally trigger worst-case behavior without being able to inspect the process's memory for the random Siphash key.