# Native Profiling Workflow (Callgrind + perf) External C++ profiling for engine hot-path work (issue #345). This is separate from the in-engine `ProfilerOverlay` / `ProfilingMetrics` live HUD (`src/Profiler.*`, `GameEngine.h`) — those show frame time / draw calls at runtime; this is for diagnosing and A/B-validating C++ optimizations (e.g. #331, #342, #343, #344). ## The profiling build The default `make` (Release, `-O3 -DNDEBUG`) omits frame pointers and ships no DWARF, so it can't be line-annotated or unwound. `make build-debug` (`-O0`) profiles the wrong (unoptimized) code. Use the dedicated profiling build instead: ```bash make profile ``` Produces `build-profile/mcrogueface`, configured `RelWithDebInfo` (`-O2 -g`) plus `-fno-omit-frame-pointer` (CMake `-DMCRF_PROFILE=ON`). Not stripped. The build is self-contained — `lib/`, `assets/`, and `scripts/` are copied next to the binary just like the normal build, so `--headless --exec` works out of the box. ## Callgrind — primary, deterministic, no special permissions Best fit for validating optimizations. `--headless --exec