New Module: Profile your JUCE UI/dsp performance with Perfetto

Thanks. Yes, I saw those. After playing with this a bit, I can say: this is really deep. And fascinating.

I took the tip of your blog post and put a trace in Component::paintComponentAndChildren():

// at top of juce_Component.cpp, outside of namespace:
#include <melatonin_perfetto/melatonin_perfetto.h>

void Component::paintComponentAndChildren (Graphics& g)
{
    auto s = getName() + "::pCAC";
    TRACE_EVENT("component", perfetto::DynamicString{ s.getCharPointer() } );

If you name all your components (as I do), you can easily see all of the nested painting and so on. Really interesting. I suspect this will be very useful in UI optimization.

Edit: great work on this, and thanks!!!

1 Like