Home to Foleys Finest Audio

What can be done to optimize control lag?

I seem to be getting varying amounts of control lag while working on my project. When I build it for Juce (which is a much simpler look) the responsiveness is very fast. I am wondering which aspects of PGM I can control, such as a certain L&F or not using gradients, size of background graphics files, stretch vs. static layout, etc. that could have an impact on this. Or, shall we say, which aspects have the most impact.

I am not sure I follow: do you mean the layout i.e. placement takes time? I realised that with a juce update or OSX update somehow resizing doesn’t work smooth. Instead the size is adapted only once you release the resizer corner.
I was told but didn’t have the time to test myself that switching off the OpenGLContext (FOLEYS_ENABLE_OPEN_GL_CONTEXT=0) and switching on the juce flag JUCE_COREGRAPHICS_DRAW_ASYNC=1 (courteousy of Eyal Amir)

Any other concern should be viewed in a release build. But I have to say my examples don’t put too much stress on the CPU, but that is a subjective observation.

No, I mean the responsiveness of the sliders to mouse movements when you are not in editing mode but rather simply just trying to use the UI. I’m on a Ryzen 2600 with 16 GB RAM, medium/low spec system these days. Yes it’s also sort of slow to respond to selecting items in editing mode, but that’s not my main concern.

I see, thanks for the report. I am working most of the time with a MacBook Pro 2015 (Intel 2.2 GHz Quad-Core i7) and even in debug I don’t see reason for concerns.
It must be said that if you don’t resize there is zero overhead from PGM.
All connections are set when opening the GUI and realised with ParameterAttachment, and so are the layout settings.
No parsing happens after that point with the exception of size dependent CSS classes. When they change some layout settings are recreated, but then it is all back to normal.
The visualisers are bespoke classes, so they cannot be compared to JUCE, because they don’t exist there :wink:

If you find a specific bottleneck I am happy to see what can be done.

I’ll see if I can narrow it down at all. Thanks.

FYI most of the time there is no issue, but sometimes there is.

Copyright © 2020-2021 Foleys Finest Audio UG. All rights reserved.