Rust High Performance
上QQ阅读APP看书,第一时间看更新

Summary

In this chapter, you learned how to use compile-time checks to your advantage. You learned how Rust's type system can help you create complex and safe behaviour without runtime overhead. You learned how to create state machines and how to make your code less error-prone.

You also learned about some extra performance enhancements that complement those of Chapter 1Common Performance Pitfalls. You learned about unstable sorting and map hashing, including perfect hash functions created at compile time, and how to create compile-time hash maps that will have no runtime overhead.

Finally, you learned about the collections in the standard library, how they are classified, and which type of collection you should use depending on the situation. You learned about sequences, maps, and sets, and how they can be adapted for your code.

In Chapter 3Memory Management in Rust, we will talk about memory management in Rust. Even if, in Rust, you do not need to manually allocate and de-allocate memory, there are still plenty of things you can do to improve your memory footprint.