Flamegraphs are very useful visualization tool used to analyze performance bottlenecks in software programs, typically focusing on CPU usage or time spent in functions. Here is a typical flamegraph produced by running FFMPEG through speedscope.app:
Apart from flamgraphs capturing time spent in functions, which is the most common, there is a whole other category of flamegraphs depicting memory allocation, interrupts, time spent in system mode, branch prediction misses etc. Flamegraphs allow users to very easily spot places in their code consuming a lot of certain type of resource.
Creating flamegraphs is usually done using a profiler. The profiler collects the statistics about program execution, the flamegraph tools generate flamegraphs from this input.
FIYA, shortened for Flamegraphs In Your App is a light-weight, mostly header-only library that allows you to programatically generate flamegraphs from your application. You programatically set where the scope of the label starts and where it ends. It can be the beginning and the end of a function, but also the beginning or the end of a component.