Add support for the Tracy profiler#8418
Open
messmerd wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for the popular Tracy Profiler.
The Tracy profiler is cross-platform, very easy-to-use, and has tons of features. However, it requires some instrumentation, which I've done in this PR.
Quick demo:
2026-05-31.22-47-23.mp4
Support can be enabled via the
-DWANT_DEBUG_TRACY=ONconfig option. When enabled, the Tracy repo will be cloned and compiled automatically. Otherwise, there is no dependency on Tracy. All Tracy instrumentation code is a no-op when Tracy profiling is disabled.The changes to the codebase are minimal:
AudioEngineWorkerThread'sQWaitCondition/QMutexusage tostd::condition_variable(orstd::condition_variable_anywhen using Tracy) /std::mutexin order for Tracy to profile them, though this wasn't strictly necessary.displayNameUtf8()methods for effects and instruments in order to pass aconst char*to Tracy efficiently. This allows traces to contain the names of plugins so we can easily identify which plugins are performing well or performing poorly.All other changes are Tracy instrumentation macros which I've added throughout the audio pipeline in order to collect useful performance information. Again, all these macros are no-ops when not using Tracy.
Through profiling, I noticed that the

EnvelopeAndLfoParameters::fillLevelmethod was taking a lot of time to execute, and I was able to achieve a significant performance improvement in 95a3bae by moving a variable outside the loop. Here's the difference it made as measured by Tracy:I'm sure Tracy will let us find and fix performance issues in many other places as well.