Profiling with Tracy
See where your plugin's time goes, zone by zone, with the Tracy profiler.
Tracy shows how long each named piece of your code (a zone) takes, block by block.
Set upLink to this section
- Install Tracy in Settings, Tools (version 0.14.1, the one Studio's builds connect to).
- Open Controls, then Debugging, and click Set Up under Tracy Profiler. Studio lists the changes first: it adds Tracy to your project and a zone around your process function.
Zones only record in Profile builds. Normal and cloud builds leave them out.
ProfileLink to this section
- Click Profile. Studio makes a Profile build and plays it in the preview; the status shows Active (Profile build).
- Play some audio, then click Open Tracy. Tracy records while it's connected.
- To go back, click Use Normal Build or build again.
The first Profile build builds everything from scratch, so it takes a few minutes. The first build after Set Up needs the internet once.
Add zonesLink to this section
Mark any code you want timed:
FREQLAB_ZONE("filter");In files that include freqlab_zone.h.
LimitsLink to this section
- Profiling works with Cargo and CMake projects, built with Studio's own steps. It's blocked by a custom build or configure command, a custom output or build folder,
COPY_PLUGIN_AFTER_BUILD TRUEinCMakeLists.txt(common in imported JUCE projects), or CMake older than 3.24. - Studio can load up to 20 Profile builds per session (each uses one of Tracy's ports, 8086 to 8105). Restart Studio to profile again after that.
With an agent set up, it can record your playing Profile build to answer a performance question; it never starts profiling on its own. Set how long it records, and how many recordings it keeps, in Settings, Debugging, Agent Profiling.