Talking about performances

Hello!

My template is becoming big and therefore I need to start doing optimization for the memory and cpu usage.
There are hundreds of widgets created dynamically which I am controlling through OSC listeners.

I am wondering if this is the right way or if instead it would be better to store the widgets in memory and call the EDIT command to change their inner properties.

When using OSC listener, I suppose there is a communication that goes from the client to the server and back?
I think the best would be to have all the code inside the client, to avoid network usage.

Looking for inspiration :smiley:

Thanks in advance
Marco

I am also working on a big template, i would opt for minimum amount of widgets. I show and hide the widgets according to objects in the custom module. To be easy accessible, the widgets have a number at the end…
Using cloned objects should improve performance too.

Avoid a lot of code in the gui, just simple things. Use the custom module…

I think the best would be to have all the code inside the client, to avoid network usage.

I'd advise the opposite: local network traffic is pretty cheap, keeping things tight in the UI and updating it with the custom module is better IMO.

1 Like

Thanks
then, if I well understood, the way to go should be to use osc listeners and receiveOSC in the custom module

It’s also possible to use the /EDIT command to modify a widget or its content (eg populate a modal widget when it opens, empty it when it closes).

Would you say that storing widget objects and calling /EDIT is more efficient than creating widgets on the fly with OSC listeners in the attributes and then send receiveOSC when needed?

Not necessarily, I just wanted to point out the possibility of regulating the number of widgets in the client, but maybe you got there already :).

Indeed :slight_smile:
I show the widgets only if really needed, otherwise I remove them

@gidash would you mind sharing an example (code) of how you do this?