# Profiling (2D FDTD) **Profiling** investigates where simulation time and hardware resources are spent. Select a workload and tools in the repository's `config` file, then run `make profile`: ```bash # config: example GPU profile settings PROFILE_TOOLS="nsys ncu" PROFILE_BACKEND="cuda" PROFILE_PERF_SIZE=1024 PROFILE_PERF_STEPS=200 ``` These settings use Nsight Systems to trace API calls and GPU work, and Nsight Compute to inspect kernel metrics. Results are saved under `results/profiles/`. For CPU work, select tools such as `perf-stat`, `perf-record`, `callgrind`, or `cachegrind`. The profile build includes symbols, frame pointers, and CUDA line information to relate observations to code. Profiling instrumentation changes execution cost, particularly under Valgrind. Use [[fdtd-cuda-benchmarking|benchmark timings]] for performance comparisons and profiles to explain them. Source: [config.example](https://github.com/yanevskiv/fdtd-cuda/blob/main/config.example).