Master the fundamental concepts of rust for systems programming through this focused micro-challenge.
Rust is fast by default, but hot paths still need data. Linux perf samples CPU stacks; cargo flamegraph wraps it into an SVG where width means time. Cloudflare and Discord publish wins found exactly this way.
bashLoading…
criterion microbenches guard against optimizing noiseperf report sorts symbols by sample count. If 40% lands in memcpy, fix allocation patterns before tweaking algorithms. If a mutex shows up wide, fix contention.
For this exercise, you will profile a small CPU-heavy program and name the top frames. This task asks you to propose one change backed by numbers, because profiling culture is what separates Rust marketing from Rust performance in production.
Keep the relevant man page, ABI doc, or Rust reference chapter open while you work. When your output disagrees with the reference implementation on the same machine, the mismatch is usually an alignment rule, an off-by-one terminator, or a register slot you misread in GDB. Skim the official documentation for the tool or ABI named in the exercise; the prose changes, but register roles, syscall numbers, and ownership rules stay stable across releases.
Profile a Rust program using perf and cargo-flamegraph.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github