Wow, getposition sure is slow (or what am I missing?)

mrtof's icon

Hi, attached you will find two patches: A-poly.maxpat and B-multiple.maxpat

Basically they both produce a bunch of spheres itching their way down the screen and wrapping back up.
A-poly.maxpat uses a poly~ that loads voice.maxpat.
B-multiple.maxpat uses a jit.gl.multiple.

Now, I noticed that A-poly.maxpat is a lot slower than B-multiple.maxpat. Through some testing, I think it has to do with the getposition message.

A-poly-notgetposition.maxpat is a modified version of A-poly.maxpat that does not use the getposition message. Notice the huge difference in framerate!

This is very strange. Any cues on how to optimize the A-poly.maxpat?

mrtof's icon

Here is the attachment.

4448.polyvsmultiple.zip
zip
Rob Ramirez's icon

hello. it is not the getposition call, but the flonum box after your unpack.
remove that and the FPS is back to normal.

remember to remove any unnecessary GUI objects first, when trying to optimize FPS, especially inside a poly~ abstraction.

mrtof's icon

Wow. I thought that when patchers where hidden that they did not update their GUIs!
So if I understand, all GUIs are updated even if they are not visible? Ouch.

Thank you once more.

mrtof's icon

If UI objets are hidden in presentation mode, do they still eat CPU?