Profiling Code in Rust - by Vitaly Bragilevsky - Rust Linz, December 2022

Published: 22 December 2022
on channel: Rust
22,473
362

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
  / rustlinz  


Watch video Profiling Code in Rust - by Vitaly Bragilevsky - Rust Linz, December 2022 online without registration, duration hours minute second in high quality. This video was added by user Rust 22 December 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 22,47 once and liked it 36 people.