<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 7, 2013 at 2:57 AM, Roman Haefeli <span dir="ltr"><<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, 2013-08-07 at 08:40 +0200, IOhannes m zmölnig wrote:<br>
> On 08/07/13 03:15, Miller Puckette wrote:<br>
> > Hmmm... I was umnder the impression that, except for the overhead of block~<br>
> > and switch~ objects, there would be no difference in DSP execution time<br>
> > between a patch having lots of subpatches and one with the same amount of<br>
> > computation all thrown in one window. I haven't made any measurements but<br>
> > theoreticall at least there shouldn't be any difference.<br>
><br>
> i once did make measurements, and they showed that your assumption is<br>
> correct.<br>
><br>
> or at least, it showed that it *was* correct at that time. this was on a<br>
> P2-400MHz in 1998 or so, where a 16 channel spatialization patch would<br>
> eat about 95% of the CPU - regardless of whether you used a single huge<br>
> patch or organized the code into subpatches/abstractions.<br>
><br>
> eventually i went for using abstractions, and let the PC run at 95% for<br>
> the 2 weeks show.<br>
<br>
</div></div>I once made some informal tests to measure the overhead of [switch~]. It<br>
turned out it is quite big and if you're running hundreds or thousands<br>
instances of [switch~] you probably gain nothing by turning DSP off in<br>
subpatches. I don't know what the sweet spot is it seems using [switch~]<br>
is only worth for subpatches with a minimum amount of (DSP) complexity.<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman</font></span><br></blockquote><div><br></div><div>I don't know why this is so... <br>When you add a [switch~] object, it adds a prologue and epilogue around the perform routines from each object in the subpatch. The runtime behavior is just like [block~], except when the patch is switched off, the switch prologue returns a pointer to the epilogue, instead of the next item in the dsp chain (don't quote me--I may need to read some code to find exact behavior, but that's the gist of it).<br>
<br></div><div>To me, this is pretty minimal and reasonable. Maybe there's an unintended consequence like cache misses when skipping over part of the dsp chain.<br></div><div><br></div><div> Chuck</div></div></div></div>