Summary

In this last chapter of the book, you learned to use asynchronous programming to avoid creating too many threads. You can now use just the right amount of threads and still run the workload in parallel and efficiently in networking applications. To be able to do that, you first learned about the futures crate, which give us the minimum primitives to use when working with asynchronous programming in Rust. You then learned how the MIO-based Tokio works, and created your first servers.

Before understanding external crates, you learned about WebSockets and grasped the Tokio core reactor syntax. Finally, you learned about the new generators syntax and how the futures crate is being adapted to make use of this new syntax. Make sure to stay up to date about the news on when this great compiler feature will be stabilized.

Now that the book came to an end, we can see that high performance can be achieved in Rust in multiple and complimentary ways. We can first start by improving our sequential code as we saw in the first chapters. These improvements come from various techniques, starting from a proper compiler configuration and ending in small tips and tricks with the code. As we saw, some tools will help us in this labour.

We can then use metaprogramming to improve both the maintainability of the code and the performance, by reducing the amount of work the software has to do at runtime. We saw that new ways of metaprogramming are arriving this year to Rust.

Finally, the last step to make things faster is to run tasks concurrently, as we saw in the last two chapters. Depending on the requirements of our project, we will use multithreading or/and asynchronous programming.

You should now be able to improve the performance of your Rust applications and even to start learning deeper concepts of high performance programming. It has been a pleasure to guide you through these topics in the Rust programming language, and I hope you enjoyed the read.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.171.107