[PD] list vs. symbol array [was: Re: Licensing issues]

Frank Barknecht fbar at footils.org
Tue Nov 6 12:19:32 CET 2012


On Mon, Nov 05, 2012 at 11:38:00AM -0800, Jonathan Wilkes wrote:
> ----- Original Message -----
> > From: Frank Barknecht <fbar at footils.org>
> > 
> > On Mon, Nov 05, 2012 at 08:26:17AM -0800, Jonathan Wilkes wrote:
> >>  How many table names total were there in the patch that was overloading
> >>  the device?
> > 
> > I don't remember anymore, that was in 2009, when the abstraction was first
> > posted here on pd-list. 
> > 
> > But if you don't believe me, just do some benchmarks on your own and compare
> > array access with list filtering.
> 
> It makes no difference if the number of table names is around 100.  At 1000 your
> method is certainly faster-- I've just never had a patch with 1000 tables.

I'm pretty sure, the patch at that time didn't either. The main problem then
was the high frequency with which lookups had to happen. As a special election
day service I have written a benchmark showing this situation. On my machine
the symbolarray uses about 16 percent CPU at the "metro" period of 0.01 ms
while list lookup uses 24. Now 0.01 ms may sound like a tempo you won't
encounter in real music, but that's wrong: In chords you play many notes at the
same time, the "period" then is a very fast 0 ms. This can generate CPU usage
spikes on slow devices if the lookup is too slow - at least that's my
explanation for why the symbolarray was able to fix the patch.

Ciao
-- 
 Frank Barknecht                                     _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m_symbolarray-help.pd
Type: application/puredata
Size: 3224 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20121106/b443ada5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m_symbolarray.pd
Type: application/puredata
Size: 6812 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20121106/b443ada5/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sym-vs-mess.pd
Type: application/puredata
Size: 4146 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20121106/b443ada5/attachment-0002.bin>


More information about the Pd-list mailing list