Master the fundamental concepts of profiling & measurement through this focused micro-challenge.
Brendan Gregg's production performance work at Netflix and Sun starts with simple wall-clock timing, then perf stat, then deeper tools. Guessing where time goes wastes weeks. A three-line time run, a perf stat pass for cycles and cache misses, and hyperfine for repeated comparisons form the baseline toolkit every systems engineer keeps on hand.
time reports elapsed, user, and system seconds for one run. perf stat samples hardware counters without modifying your binary. hyperfine warms up, runs many iterations, and prints mean plus standard deviation so you can see noise.
bashLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will benchmark a small C program with time, perf stat, and hyperfine, then print a short comparison table. This exercise asks you to treat measurement as the first optimization step, not an afterthought.
Implement benchmarking using time, perf stat, and hyperfine tools.
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