[PD] Sometimes all data-structures are redrawn

Roman Haefeli reduzent at gmail.com
Sat Mar 4 23:17:15 CET 2023


Hey all

Sometimes when I load certain patches containing data structures, all
data structures in all patches of an instance of Pd are redrawn. This
is barely noticeable with one single patch, but if  many patches are
loaded with each using many scalars, the whole redrawing process
becomes unbearable. In larger netpd sessions, the process can take a
few dozen seconds, depending on number of loaded instruments and
probably other factors (maybe CPU speed, but none of the cores is fully
loaded during the redrawing process). During the process, GUI elements
like slider handles or number boxes are not updated and all DS based
GUIs are not usable either. [cnv] labels are not affected (why?). The
redrawing seems to cause drop outs in DSP processing. I got reports
that glitches are more pronounced on Windows (or on slower computers?).

I tried  to figure out what exact conditions trigger such a redraw in
the hope that they can be avoided. I found that the order objects of a
data structure template are created matters. If [drawsymbol] was
created before [struct], loading such a patch triggers the redraw.
After changing the creation order, loading the patch doesn't trigger
the redraw. This video illustrates it:

https://netpd.org/~roman/tmp/ds-redrawing-everything.webm

Apparently, there are other conditions that trigger a redraw. I tried
to make sure that all [struct] objects are created last in one of my
patches, but loading the patch still triggers the redraw. 

What are the conditions that lead to a redraw? Why are all data
structures redrawn and not only the ones using scalars from the changed
template? If order matters, why aren't the patches saved with the
correct order? Why is the process so slow if it is apparently not CPU-
bound? Is it because of the "chattiness" between GUI and core?

Here another video showing how redrawing affects iemguis:

https://netpd.org/~roman/tmp/ds-redrawing-affects-iemguis.webm

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20230304/d3439d82/attachment.sig>


More information about the Pd-list mailing list