Once your application avoids common performance bottlenecks, it's time to move to more complex performance improvements. Rust has many options that allow you to improve the performance of your code by using lesser-known APIs. This will give you parity with C/C++ and, in some scenarios, it can even improve the speed of most of the fastest C/C++ scripts.
In this chapter, we will be looking into the following topics:
- Compile-time checks
- Compile-time state machines
- Extra performance enhancements, such as using closures for avoiding runtime evaluation
- Unstable sorting
- Map hashing
- Standard library collections