[Stk] fast time domain filter implementation

Gary Scavone gary at ccrma.Stanford.EDU
Tue Apr 15 09:22:20 PDT 2008


Hi Stephen,

The vector [] operator does not do bounds checking and it _should_ be  
defined inline by the class.

I think the Windows stutter problem is more related to  
DirectSound ... it's a terrible API.  Always use ASIO drivers on  
Windoze if possible.

Note that there are currently inefficiencies with virtualized  
functions in many of the classes, though that shouldn't be the case  
when using the Filter class.  It would be an issue with subclasses of  
Filter.  This is something I plan to address this Spring/Summer.

Regards,

--gary

On 15-Apr-08, at 12:14 PM, Stephen Sinclair wrote:
> Emile Vrijdags wrote:
>> In response to Steven and Immanuel
>>
>> The problem is that the profiler (vtune) requires the project to be
>> built in debug mode (afaik: I've been using it since last week),  
>> and no
>> optimizations are present. So I probably have a distorted image of  
>> the
>> performance of that function.
>>
>
> Ha, I thought that might be it.
> I think a lot of template code in C++ gets *much* more optimized with
> even the smallest optimization setting.  That said, of course it's
> possible that the Vector class isn't the _most_ efficient thing that
> could be used, since it inserts a functional call before the array
> look-up, not to mention that it will always check for out-of-bounds
> access, etc.  But I think as soon as that function call gets in-lined
> the performance shoots way up.
>
>> In my full application using opengl in multithreaded environment  
>> (opengl
>> renderloop, an update filterparameters loop, and the stk callback  
>> loop)
>> there is an even more significant performance gain between vs2005 and
>> intel compilers. I can use about double the amount of filters  
>> before the
>> audio starts to be chopped up.
>>
>
> That's interesting actually, I remember now that when I first compiled
> my STK Piano program on Windows, I got _very_ choppy audio and was a
> little freaked out by the CPU meter, until I turned on the  
> optimization
> flags--so I guess I've noticed this too.  Comparatively I had never
> noticed this problem on Linux, so I guess GCC does a better job  
> than VS.
>
> If you want to continue your comparison a good test case might be  
> to try
> GCC under Cygwin and/or mingw.
>
> Keep in mind that the tick() function in STK is called on every sample
> for every ugen, so this is always going to be less efficient than
> vectorized code.  On the other hand, it makes it possible to do things
> with single-sample delays (like waveguide modeling) that is impossible
> otherwise.  Call it a trade-off.
>
>
> Steve
>
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk



More information about the Stk mailing list