TIL that Rust's dbg! macro also works in release builds, so you can debug issues when you need the perf of a release build.
This differs from debug_assert! which is ignored in release builds.
Rust's dbg! macro (new in 1.32) is delightful. You write dbg!(my_var) and you get a print statement that writes:
[src/my_file.rs:123] my_var = "value of my_var"
It's a huge ergonomic help when debugging!
One interesting feature of Rust: it has both print and dbg, so you don't need to use print for debugging very often. I don't even use print that often.
Rust's model of references confused me when I started out. I'd read that they were faster, so I tried to use them everywhere. You can't return a reference to a new vector though!
Now I see them as primarily useful for signalling 'this parameter is not modified' rather than perf.