<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Your [pd drip] does a lot of extra work. It's go basically linear stack performance, and you're recopying the list every loop (an until loop would solve this for a little extra cpu time). The secret of [list-drip] is that it doesn't recopy the list using the [list] object, and it avoids stack overflows by doing the recursion split at the midpoint of the list and only outputting when it's done the binary split down to lists of size 1, which are the elements, or size zero, which are bangs (and which are filtered out).</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Since it's binary recursion on the list, the stack only grows proportionally to log_2(n), which is about 20 for n=1,000,000. It's still going to be slower than an object written in C that can just iterate over the contents in a single loop, and lists in Pd are slower in general than arrays, so an until loop and tabread over an array is going to be quicker. It is much slower for copying though -- an until loop with tabread and tabwrite has way more overhead than an [array get]-[array set] pair.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 4, 2015 at 1:06 PM, Christof Ressi <span dir="ltr"><<a href="mailto:christof.ressi@gmx.at" target="_blank">christof.ressi@gmx.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Verdana;font-size:12.0px"><div>
<div>Please don't use the previous version of the multi-dimensional arrays!!!</div>

<div>First, I forget to get rid of one [drip] object. Second, I discovered that [pd drip] will create a stack overflow if there are more than ca. 300 elements! (Why???) So I replaced it with [list-drip] which works fine.</div>

<div> </div>

<div>So here's the corrected pure vanilla version + a zexy version using [drip]. I prefer to use the latter one because it's waaaaay faster than all the drip abstractions based on [list split].</div>

<div> </div>

<div>Vanilla: <a href="https://www.dropbox.com/s/wd0avxtaneqgdic/carray_vanilla.zip?dl=0" target="_blank">https://www.dropbox.com/s/wd0avxtaneqgdic/carray_vanilla.zip?dl=0</a></div>

<div>Zexy: <a href="https://www.dropbox.com/s/ea8kihwbdqhcajr/carray_zexy.zip?dl=0" target="_blank">https://www.dropbox.com/s/ea8kihwbdqhcajr/carray_zexy.zip?dl=0</a></div>

<div> </div>

<div>Christof</div>

<div> </div>

<div>PS:  I did a benchmark test of iterating through an array of 1 million elements, using [realtime], and here's what I found on my system:
<div> </div>

<div>[array get] + [drip] --> ca. 6.5-9ms</div>

<div>[until] + [tabread] --> ca. 120-200ms</div>

<div>[array get] + [list-drip] --> ca. 340-400ms</div>

<div> </div>

<div>To me this result was a bit surprising...</div>

<div> </div>

<div>You can test yourself with the attached patch.</div>
</div>

<div>
<div name="quote" style="margin:10px 5px 5px 10px;padding:10px 0 10px 10px;border-left:2px solid #c3d9e5;word-wrap:break-word">
<div style="margin:0 0 10px 0"><b>Gesendet:</b> Sonntag, 04. Oktober 2015 um 17:32 Uhr<br>
<b>Von:</b> "Christof Ressi" <<a href="mailto:christof.ressi@gmx.at" target="_blank">christof.ressi@gmx.at</a>><br>
<b>An:</b> "Matt Barber" <<a href="mailto:brbrofsvl@gmail.com" target="_blank">brbrofsvl@gmail.com</a>><div><div class="h5"><br>
<b>Cc:</b> Pd-List <<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>><br>
<b>Betreff:</b> Re: [PD] array-abs</div></div></div><div><div class="h5">

<div name="quoted-content">
<div style="font-family:Verdana;font-size:12.0px">
<div>
<div>Wow, looks cool!</div>

<div> </div>

<div>Just a few days ago I reworked some of my personal table abstractions, which also make use of the [array] object. However, some of them depend on zexy externals (I hope I didn't miss any other dependencies). I haven't shared them yet so the documentation is quite poor (no help files, docs inside the abstraction) and they look a bit messy. But maybe you can get some inspiration for your library... <a href="https://www.dropbox.com/s/xvj031korqw8guf/ctab-abs.zip?dl=0" target="_blank">https://www.dropbox.com/s/xvj031korqw8guf/ctab-abs.zip?dl=0</a></div>

<div> </div>

<div>Additionally I've been working on three basic abstractions for creating, setting and reading multi-dimensional arrays of any number of dimensions. They are pure vanilla style and even come with a help file :-D.  (a object for array resizing is yet to be done...) <a href="https://www.dropbox.com/s/6xfgdyt697138e6/carray.zip?dl=0" target="_blank">https://www.dropbox.com/s/6xfgdyt697138e6/carray.zip?dl=0</a></div>

<div> </div>

<div>Would be cool to hear your opinion on the multi-dimensional array stuff!</div>

<div> </div>

<div>Christof</div>

<div> </div>

<div> </div>

<div> </div>

<div> 
<div style="margin:10.0px 5.0px 5.0px 10.0px;padding:10.0px 0 10.0px 10.0px;border-left:2.0px solid rgb(195,217,229)">
<div style="margin:0 0 10.0px 0"><b>Gesendet:</b> Samstag, 03. Oktober 2015 um 22:32 Uhr<br>
<b>Von:</b> "Matt Barber" <<a href="mailto:brbrofsvl@gmail.com" target="_blank">brbrofsvl@gmail.com</a>><br>
<b>An:</b> "IOhannes m zmölnig" <<a href="mailto:zmoelnig@iem.at" target="_blank">zmoelnig@iem.at</a>><br>
<b>Cc:</b> Pd-List <<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>><br>
<b>Betreff:</b> Re: [PD] array-abs</div>

<div>
<div>
<div class="gmail_default" style="font-family:verdana,sans-serif">Thanks.</div>

<div class="gmail_default" style="font-family:verdana,sans-serif"> </div>

<div class="gmail_default" style="font-family:verdana,sans-serif">Yes. Right now I'm just looking to see if these would be useful, if there's anything awful about the syntax, if they try to do too much or are too fussy, if anyone would want to contribute, etc. When I get them polished a bit I'll do a regular release on the normal channels (I can't remember if I have access to anything officially Pd related).</div>

<div class="gmail_default" style="font-family:verdana,sans-serif"> </div>

<div class="gmail_default" style="font-family:verdana,sans-serif">Matt</div>
</div>

<div class="gmail_extra"> 
<div class="gmail_quote">On Sat, Oct 3, 2015 at 4:22 PM, IOhannes m zmölnig <span><<a>zmoelnig@iem.at</a>></span> wrote:

<blockquote class="gmail_quote" style="margin:0 0 0 0.8ex;border-left:1.0px rgb(204,204,204) solid;padding-left:1.0ex">hi,<br>
<br>
great!<br>
<br>
On 10/03/2015 07:36 PM, Matt Barber wrote:<br>
><br>
> <a href="https://www.dropbox.com/s/45tk62dpz0z2mqo/array-abs.zip?dl=0" target="_blank">https://www.dropbox.com/s/45tk62dpz0z2mqo/array-abs.zip?dl=0</a><br>
><br>
<br>
db?<br>
<br>
would you like to put those on a version control system of sorts, e.g.<br>
the puredata svn or some publicly available git repository (e.g. github)?<br>
<br>
(read as: please let us not go back to the dark ages, where code was<br>
shared by sending files around by on floppy disks and you never new<br>
which version was the current one)<br>
<br>
fgmards<br>
<span><font color="#888888">IOhannes</font></span><br>
<br>
<br>
<br>
_______________________________________________<br>
<a>Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
 </blockquote>
</div>
</div>
_______________________________________________ <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a></div>
</div>
</div>
</div>
</div>
_______________________________________________ <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a></div>
</div></div></div>
</div>
</div></div></div></blockquote></div><br></div>