[PD] long list-building time

Roman Haefeli reduzent at gmail.com
Wed Mar 13 18:49:50 CET 2013


On Mit, 2013-03-13 at 09:12 -0700, Jonathan Wilkes wrote:
> Hi list,
>      See attached for difference between building a list
> of symbols through [list append] and building an array
> of symbols.
> 
> 
> Now, I know the ds array resizing and setting is
> more efficient than building out a list using [list append],
> but I don't understand why the [list append] takes over
> a minute to complete.  It can't be due to symbol table
> stuff since I'm using the same symbol over and over.

[list append] is not particularly slow, but your algorithm of appending
is. You are passing 45000 + 44999 + 44998 + 44997 .... + 1 symbols
around, which is obviously very inefficient.

I added another method to your patch that uses [add $1( to a message box
to append many symbols to a list. While the [list append] method takes
15s on my machine, the messagebox method takes only 9 ms. 

Roman 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dsresizing2.pd
Type: text/x-puredata
Size: 2443 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130313/6e422411/attachment.bin>


More information about the Pd-list mailing list