Csound Csound-dev Csound-tekno Search About

[XTCSOUND] Performance

Date1998-05-29 02:03
FromErez Webman
Subject[XTCSOUND] Performance
Probably the most substential problem I have with Extended Csound is 
performance. Consider the following Csound program:

~~~ SCO file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i1 0 5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~ ORC file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sr        =         44100
kr        =         441
ksmps     =         100  
nchnls    =         2

instr     1 
ain       =         0
          clkon     1
adel      delay     ain, 0.1
          clkoff    1
          clkon     2
aout      =         ain + adel*0.9995
          clkoff    2
          outs12    aout
endin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The debug screen displayed:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clock 1:  4192955.000000 time units in 2205 kprds, cost = 0.839 mips
clock 2:  2410334.000000 time units in 2205 kprds, cost = 0.482 mips
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Let's assume that delay implementation costs 10 ticks of the processor time
(a reasonable speculation?), so I would expect delay to cost about
0.45 mips (10*44100 = 441000 ~ 0.45 mips.).

Evaluating "aout = ain + adel*0.9995" seems to be even simpler...

Please note that I executed this program with the -D3 parameter. Omitting this
parameter doubles the cost.

For me, this is a ***REAL*** problem, since I tend to use "primitive" opcodes
such as the above a lot. ADI said that they clocked the delay opcode at 
0.19 MIPS.

Any ideas why I get so different results? Can it have anything to do with the
fact that the host PC is only a 120MHz Pentium? (I believe not, but who knows, 
maybe there is some handshaking going on which generates a bottleneck???).

Thanks,
Erez Webman