Summary

In this chapter, we discussed optimizations. First, we explored tools for measuring performance—Welle, which is an alternative to the classic Apache Benchmarking tool, and Drill, which uses scripts to perform load tests.

Then we created a tiny microservice and measured its performance. Focusing on results, we applied some optimizations to that microservice—we avoided blocking a shared state for reading, we reused a value by a reference instead of cloning it, and we added the caching of rendered templates. Then we measured the performance of the optimized microservice and compared it with the original version.

In the last section of this chapter, we got acquainted with alternative techniques of optimization—using LTO, aborting execution without backtracing instead of panicking, reducing the size of a compiled binary, benchmarking small pieces of code, and using profiling for your projects.

In the next chapter, we will look at creating images with Rust microservices using Docker to run microservices in containers with preconfigured environments to speed up delivery of your product to customers.

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

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