Hello all,
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.
Is there a better way of doing this?
Did this make any sense?
Mike
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.
Frank Barknecht _ ______footils.org_ __goto10.org__
On 10/3/06, Frank Barknecht fbar@footils.org wrote:
Hallo, 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.
I do this all the time, it is a lot faster. I'm not sure, though, if it is possible to have an array within a data structure without plotting it?
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.
That happened when I would store several one-period audio waveforms in data structures, with 12000 samples each. Since all of the connections in the main patch were at the end, nothing would be connected. I'm pretty sure I've saved patches, though, with whole audio files loaded in arrays and not had a problem. Does this not cause a problem with non-data-structure arrays? It might also have just been because the patch that gave me problems was far bigger on its own than the others that didn't.
On 10/3/06, Frank Barknecht fbar@footils.org wrote:
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.
This is just as well, as I am not really plotting any graphics.
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.
I have seen this, too. It happened on one of my patches, and the only solution was to open it up in a text editor, and manually delete all the data from the subpatch.
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.
Is there a way to save the data directly from the subpatch? Or would the data need to be copied into a textfile object, and written from there?
What I am trying to get at is it would be nice if it were possible to create this instance data, pass it to the objects that need that data, and then have it deleted from the subpatch once it is no longer required. I am working on creating some granular synthesis stuff, and as a result, there is a lot of data that gets generated. I found this out the hard way, as one of my patches (when I accidentally saved it) ended up being on the order of 18 megs, and this made me wonder if there is a limit that PD has while running in realtime.
Thanks,
Mike
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, Mike McGonagle hat gesagt: // Mike McGonagle wrote:
On 10/3/06, Frank Barknecht fbar@footils.org wrote:
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.
Is there a way to save the data directly from the subpatch? Or would the data need to be copied into a textfile object, and written from there?
You can save directly by sending "write filename.txt" to the subpatch-receiver (like [write file(---[s pd-data]) and read back in with a "read file" message.
What I am trying to get at is it would be nice if it were possible to create this instance data, pass it to the objects that need that data, and then have it deleted from the subpatch once it is no longer required. I am working on creating some granular synthesis stuff, and as a result, there is a lot of data that gets generated. I found this out the hard way, as one of my patches (when I accidentally saved it) ended up being on the order of 18 megs, and this made me wonder if there is a limit that PD has while running in realtime.
The funny thing is, that running such a 18MB patch is no problem, however opening it again after saving is a problem. Hopefully this can be sorted out sometime.
Frank Barknecht _ ______footils.org_ __goto10.org__
me too:
I had a patch that stored data in two very big arrays at the start and one day I opened it and ... everything disconnected and bits missing. :(
On Tue, 3 Oct 2006 13:16:10 -0500 "Mike McGonagle" mjmogo@gmail.com wrote:
I have seen this, too. It happened on one of my patches, and the only solution was to open it up in a text editor, and manually delete all the data from the subpatch.