rprof
CPU scope based profiling library and browser based profile inspector with ImGui visualization
rprof: a scope based profiler that catches slow frames
A CPU profiling library built around a time threshold, with ImGui visualization and a browser based inspector for frames that run too long.
The core idea
rprof is a scope based CPU profiling library with ImGui visualization and a browser profile inspector. The core concept is a time threshold, which can be used to catch functions or entire frames that exceed a certain time value. The README says optimization work can then focus first on frames and functions that are only occasionally slow, and iterate toward more consistent performance. The library is written in C and released under a BSD style license.
How the threshold works
The profiler always runs when used, but it displays only those frames that exceed the given threshold. The default value of zero means every frame is displayed. The level value refers to hierarchical scope depth, where a value of zero represents an entire frame. This focuses attention on the slowest scopes rather than drowning in every measurement.
Building it
A GENie script can generate a Microsoft Visual Studio solution or makefiles for a GCC based compiler or cross compiler. Generating an MSVC solution is shown as a command example. All generated solutions and makefiles provide Debug, Release, and Retail configurations in both 32bit and 64bit versions, though some platforms support only one word size, such as OSX working with 64 bit builds only. Batch files in a scripts directory fetch dependencies for the demo and generate project files.
The browser inspector
Captured frame profiles can be saved to binary files for offline inspection. The browser based inspector is built using Emscripten and is based on ImGui, offering interactive zooming and panning as well as a statistical overview of the frame. The README says the viewer is browser based so it can be used as part of a QA pipeline during development.
Community notes