In this section, we'll focus on the serial performance of a common data structure—associative arrays. We'll apply the tools we learned about in the previous chapter to probe different implementations. We'll focus on the associative array because it is fairly well-trod territory, studied in introductory computer science courses, and is available in most higher-level languages by default, Rust being no exception save the higher-level bit. We'll look at Rust's associative array first, which is called std::collections::HashMap.
Performance
Standard library HashMap
Let's poke around in HashMap's internals. A good starting place, I find, for inspecting unfamiliar Rust data structures is...