On 11/17, Oleg Nesterov wrote:
>
> However, if ffarity() == 0
>
>       a = fconstant(float a, "");
>       b = fconstant(float b, "");
>
>       c = a / b;
>
>       f0 = ffunction(float f0(), "","");
>       process = f0 : *(c);
>
> then "a / b" is calculated at run time:
>
>       virtual void instanceConstants(int sample_rate) {
>               fSampleRate = sample_rate;
>       }
>       virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, 
> FAUSTFLOAT** RESTRICT outputs) {
>               FAUSTFLOAT* output0 = outputs[0];
>               for (int i0 = 0; i0 < count; i0 = i0 + 1) {
>                       output0[i0] = FAUSTFLOAT(f0() * a / b);
>               }
>       }
>
> and this looks like performance bug to me.

OK, I am not sure but it seems that mterm::normalizedTree() is confused by
getSigOrder(f0). The patch below seems to fix the problem.

What do you think?

Oleg.

diff --git a/compiler/signals/sigorderrules.cpp 
b/compiler/signals/sigorderrules.cpp
index d30248ccc..4866122e4 100644
--- a/compiler/signals/sigorderrules.cpp
+++ b/compiler/signals/sigorderrules.cpp
@@ -128,7 +128,7 @@ static int infereSigOrder(Tree sig)
         return O(s1);
 
     else if (isSigFFun(sig, ff, ls) && isNil(ls))
-        return 1;
+        return 3;
 
     else if (isSigFFun(sig, ff, ls))
         return max(1, O(ls));



_______________________________________________
Faudiostream-devel mailing list
Faudiostream-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-devel

Reply via email to