youtube image
From YouTube: Profiling Code in Rust - by Vitaly Bragilevsky - Rust Linz, December 2022

Description

Profiling is a way to understand program behavior in terms of time and memory usage at runtime. Profiling is generally considered an advanced topic, but it doesn't have to be hard at all!

In this talk, I want to present and discuss various approaches, tools, and crates that help us to explore time and memory usage of our programs. We’ll explore a simple project, discover its characteristics and see what can be done to optimize them. We’ll see how to measure the timings of code fragments and functions reliably. We'll look at flame graphs and learn how to understand them. We’ll talk about such techniques as reserving memory in advance, avoiding creating auxiliary data structures, and removing unnecessary memory operations. We’ll also see that extensive correctness testing is a must-do when optimizing code because making programs faster and more memory-efficient should not lead to making them incorrect.

It's okay to profile our code along with writing it. It's not about unneeded premature optimization, it's about doing it right at the first run!

Slides: https://bit.ly/profiling-rust

Rust Linz:
https://sessionize.com/rust-linz
https://rust-linz.at
https://fosstodon.org/@rustlinz
https://twitter.com/rustlinz