Contiguous memory places elements in adjacent addresses. Rust’s Vec benefits from this layout: nearby data is cache-friendly, and moving elements can often be handled with fast memory copying. section 10.4
These advantages make Vec a strong default for many workloads, but not a universal winner. Some sets, maps, trees, or linked lists can outperform it; benchmark before choosing a more complex structure. section 10.4
Compare collection performance
Benchmark Vec, HashSet, and LinkedList for appending, searching, and removing elements to see how their performance differs across operations. section 10.4

