Making Day 14 Part 2 3,000 TIMES FASTER with Flamegraphs | Advent of Code 2022 in Rust with Corey

Hey I’m Corey and I’ve been writing Rust in my free time for a few years and recently started streaming some of my coding. I'm almost a month late with this now, but better late than never! Yesterday I filmed Day 14 Part 2, and at the end of the video I took a sec trying to see what might be making my code slow. I said that I could profile it and make a flamegraph but decided against it. Well about an hour after filiming I got curious and made a flamegraph! And wow, was I surprised. One small tweak and my solution was running THREE THOUSAND TIMES faster! In this video we walk through the problem, and then we use `cargo-flamegraph`: We also learn how to use `#[inline(never)]` to hint to Rust to keep functions in the stack trace which can help in finding things that might have been inlined! Check out my Github Sponsors to support me so I can keep making videos! The Github Repo can be found here: Advent of Code Site: ----------- Day 1: Day 2: Day 3: Day 4: Day 5: Day 6: Day 7: Day 8: Day 9: Day 10: Day 12 Session 1: Day 12 Session 2: Day 12 Session 3: Day 13: Day 14 Part 1:

coreyja weekly

My weekly newsletter tailored at developers who are eager to grow with me!
Every week will be unique, but expect topics focusing around Web Development and Rust