Show HN: Single-Header Profiler for C++17
a year ago
- #performance
- #profiling
- #C++
- utl::profiler is a single-include solution for localized profiling with simple macros.
- Features include measuring time for scopes, expressions, and code segments, with automatic call graph generation.
- Supports multi-threading, recursion, CPU-counter timestamps, and can export results at any program point.
- Profiling can be fully disabled via `UTL_PROFILER_DISABLE`.
- Includes style options for formatting results, such as indentation and color coding based on runtime percentages.
- Low overhead design with options to use CPU-counter intrinsics (`rdtsc`) for reduced profiling overhead.
- Memory overhead is minimized, with options to use smaller IDs (`UTL_PROFILER_USE_SMALL_IDS`) for further reduction.
- Thread-safe API with minimal locking required only during thread creation, joining, or manual result upload.