<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">&lt;<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>&gt;</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>
&gt; On 08/07/13 03:15, Miller Puckette wrote:<br>
&gt; &gt; Hmmm...  I was umnder the impression that, except for the overhead of block~<br>
&gt; &gt; and switch~ objects, there would be no difference in DSP execution time<br>
&gt; &gt; between a patch having lots of subpatches and one with the same amount of<br>
&gt; &gt; computation all thrown in one window.  I haven&#39;t made any measurements but<br>
&gt; &gt; theoreticall at least there shouldn&#39;t be any difference.<br>
&gt;<br>
&gt; i once did make measurements, and they showed that your assumption is<br>
&gt; correct.<br>
&gt;<br>
&gt; or at least, it showed that it *was* correct at that time. this was on a<br>
&gt; P2-400MHz in 1998 or so, where a 16 channel spatialization patch would<br>
&gt; eat about 95% of the CPU - regardless of whether you used a single huge<br>
&gt; patch or organized the code into subpatches/abstractions.<br>
&gt;<br>
&gt; eventually i went for using abstractions, and let the PC run at 95% for<br>
&gt; 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&#39;re running hundreds or thousands<br>
instances of [switch~] you probably gain nothing by turning DSP off in<br>
subpatches. I don&#39;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&#39;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&#39;t quote me--I may need to read some code to find exact behavior, but that&#39;s the gist of it).<br>
<br></div><div>To me, this is pretty minimal and reasonable.  Maybe there&#39;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>