FIYA – Flamegraphs in Your App

We at Johnny’s Software Lab LLC are experts in performance. If performance is in any way concern in your software project, feel free to contact us.

Flamegraphs are great way to visualize resource consumption in your program and I am their big fan (I have written about them on two occasions – here and here). My biggest concern with flamegraphs is when the tooling is bad or missing: to create flamegraphs, you need to have a good profiler and a binary compiled with debug symbols – otherwise it doesn’t work. As an embedded engineer, this is more often not the case than it is.

I developed FIYA, shortened for Flamegraph In Your App, a really simple, (mostly) header-only, lightweight library you can use to generate flamegraphs programatically. You just need to mark where the scopes of your components/functions begin and end, and the recorder part of FIYA will collect all the necessary data and convert it to flamegraphs.

I added examples on how to collect flamegraphs with runtime information and heap usage. I also added an example where FIYA is using compiler’s instrumentation framework (using -finstrument-functions in CLANG and GCC) to collect runtime information – albeit this method is very slow since every function is instrumented.

If this raises your interest, you can learn more about the library or try it out. The link is this.

Do you need to discuss a performance problem in your project? Or maybe you want a vectorization training for yourself or your team? Contact us
Or follow us on LinkedIn , Twitter or Mastodon and get notified as soon as new content becomes available.

Leave a Reply

Your email address will not be published. Required fields are marked *