[PD] Findings regarding performance

Charles Henry czhenry at gmail.com
Fri Dec 2 19:41:08 CET 2011

On Thu, Dec 1, 2011 at 4:02 PM, Mathieu Bouchard <matju at artengine.ca> wrote:
> Le 2011-12-01 à 10:39:00, Charles Henry a écrit :
>> When using [*~ 0], the inlet and outlet are borrowed.  The scalar multiply
>> operation is performed in place and no data transfer occurs.
> What do you call « data transfer » ? multiplying in place by a constant
> involves as many reads and writes as doing a (single) copy. This at least
> needs to stream data from the highest-speed RAM to the CPU and back. It's
> less noticeable than the copy time of very large buffers (e.g. [table] or
> [pix_separator]) because those really need big RAM (which is slower), but in
> any case, calling scalartimes_perf8 (or whatever) means an implicit copy in
> some kind of way, just like nearly anything else does.

You make a good point--I wasn't counting the data transfer that occurs
between registers or the way that the compiler breaks out the steps
involved, and of which I am mostly ignorant.

The part I was differentiating from: there's significant data transfer
operations that has to do with switch~.  The inlet~ inside a subpatch
and outlet on the parent from canvases using switch~ have signals that
aren't borrowed.  This means there's another data transfer (a copy)
between signals on the parent and the sub-canvas.

So, using switch~ as in Roman's example involves 2 copy operations on
the signals.  Is that what we're seeing?  I'm not sure how to count
the operations--and how to compare the scalartimes perform routines vs
inlet_doprolog/inlet_dsp and outlet_dsp/outlet_doepilog (which I'm
contending is the difference we're seeing in the performance numbers).


More information about the Pd-list mailing list