Performance of Rust Applications
300 pages
English
PDF
4.5

Performance of Rust Applications

Performance of Rust Applications

Author:

Year:

Summary:

The book "Performance of Rust Applications" is a practical guide for developers who want to get the most out of the Rust language. Unlike superficial tutorials, this book focuses on real optimization methods: from micro-optimizations at the instruction level to architectural solutions for high-load systems.



Who is this book for?

  • Developers transitioning to Rust from C++, Python, or Go who want to understand how to leverage its strengths.
  • Engineers working on real-time systems, games, network services, or embedded software.
  • Anyone who has encountered performance issues in Rust and wants to learn how to diagnose and fix them.


What will you learn?

  • Profiling and Benchmarking: how to use perf, flamegraph, valgrind, and built-in Rust tools (cargo bench, criterion).
  • Memory Management: optimizing allocations, working with arenas, understanding cache misses and data alignment.
  • Concurrency and Asynchrony: how to avoid data races, choose between async/await and threads, configure token pools.
  • Zero-cost Abstractions: how iterators, closures, and generics affect performance, and when to write low-level unsafe code.
  • Compiler Optimization: LTO flags, PGO, linker configuration, using target instructions (AVX, SIMD).
  • Working with I/O: minimizing system calls, buffering, using mmap and io_uring.


Book Structure

The book is divided into three parts: "Performance Fundamentals" (tooling, profiling, benchmarking), "Advanced Techniques" (asynchrony, concurrency, SIMD, distributed systems), and "Workshop" (analysis of real projects: web server, database, game engine). Each chapter contains code examples, graphs, and checklists for self-assessment.



This book is not about "how to write Hello World," but about how to make your code fast, reliable, and scalable. After reading it, you will be able to independently find bottlenecks in Rust projects and eliminate them.



Recommended for Junior+ and Middle-level developers familiar with Rust syntax.

Recommendations