[PD] object that routes bangs to different outputs like a counter?

Christof Ressi christof.ressi at gmx.at
Fri Oct 13 23:35:44 CEST 2017


> from the idea that a c-compiled external is better/faster/less 
> CPU-expensive etc. than a self-made abstraction.

generally that's true but in most cases it doesn't matter that much, especially for control objects since they rarely are the bottleneck of your patch. also there's a saying: "premature optimization is the root of all evil".

however, there are times where it can really matter, mostly in the signal domain. if you have lots of primitive signal objects (like [*~], [+~] etc.) what happens is that for each operation on a signal vector you call a perform routine and loop over all samples (again and again). if you can put everything inside one big loop, the C compiler has a chance to optimize quite a lot. sometimes the external version would only need half the CPU or less, but your mileage may vary. only do it if you need to squeeze as much performance out of your patch as possible - and profile first!

Christof



> Gesendet: Freitag, 13. Oktober 2017 um 18:52 Uhr
> Von: oliver <oliver at klingt.org>
> An: pd-list at mail.iem.at
> Betreff: Re: [PD] object that routes bangs to different outputs like a counter?
>
> IOhannes m zmölnig wrote:
> > On 10/13/2017 11:06 AM, enrike wrote:
> >> I know, but I just wanted to know if there something that does the same
> >> job but within a single object
> >
> > why?
> > what does it buy you? what does it cost you?
> 
> that's an interesting issue in general:
> 
> i guess the quest for a "single object" to perform a specific task stems 
> from the idea that a c-compiled external is better/faster/less 
> CPU-expensive etc. than a self-made abstraction.
> 
> is this even true for PD ?
> 
> (a long time ago i heard that this was true for MAX, but never quite 
> figured out why)
> 
> or does it depend on the complexity/size of the task ?
> 
> 
> would be great to hear an expert's opinion on that, as i often find 
> myself caught in the same thinking (looking for externals instead of 
> patching an abstraction), maybe totally unnecessary ...
> 
> thanks for all insights !
> 
> 
> 
> oliver
> 
> 
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
>



More information about the Pd-list mailing list