[PD] Question about Data Structures and passing pointers around...

Frank Barknecht fbar at footils.org
Tue Oct 3 12:50:04 CEST 2006


Hallo,
Mike McGonagle hat gesagt: // Mike McGonagle wrote:

> I have found that when sending messages, it is far more efficient to
> pass pointers to data structures, rather than passing a list of all
> the parameters in the data structure. But, it also seems that I need
> to append a new data structure to a canvas that is used to store this
> instance data. Because I am working with granular synthesis, I am
> generating a lot of data, and a lot of elements in the canvas data
> structure.
> 
> While so far, in playing with what I have done, I have not really run
> into any problems with running out of memory to store all my instance
> data, I was just curious is there are any concerns revolving around
> creating a lot of instance data within a canvas data structure.

I have found that drawing a lot of data structures can have a bad
effect on performance, but if you either close the [pd data] subpatch
or if you use structures without graphical representations (yes,
that's of course possible) you won't experience this. 

Another issue that has been reported in the past is a kind of
corruption of the patch if you stored too much data inside the patch.
It may happen, that Pd isn't able to open this patch anymore because
it has to restore too much data in the data-window on startup. 

Clearing the data window before saving is a way around this problem.
You can also save the data to an external file before closing the
patch and then restore from that file later. This seemed to happen
for example if you use structs with large arrays.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__




More information about the Pd-list mailing list