[PD-dev] Typical DSP code inefficiencies

chris clepper cgc at humboldtblvd.com
Fri Apr 2 21:21:50 CEST 2004


On Apr 2, 2004, at 12:34 PM, Matthew Laughlin wrote:

> Hi,
>
> I'm working on something at the moment and it works and all but it's 
> very inefficient. What are typical causes of ineffiiciency in DSP 
> code?

Oh boy, that's a million dollar question (quite often literally too).  
There's no one cause, so post your code somewhere for people to look at 
it and/or run a profiler on it (vtune from Intel or Shark from Apple).

Here are some general things not to do in a tight loop:

- division
- modulo
- allocate memory
- have excessive data dependencies between operations
- branch (if statements)
- floating point to integer conversion or vice versa
- copying memory

And that's just the very tip of the iceberg.  For anything more 
specific, information about the algorithm, platform and desired 
performance metrics are needed.

cgc

> Matt
>





More information about the Pd-dev mailing list