[PD] Profiling Objects or hole Patches

Claude Heiland-Allen claude at mathr.co.uk
Mon Mar 30 00:19:28 CEST 2015


Hi Markus, list,

On 29/03/15 16:08, mr. markuese wrote:
> what is the best way to measure needed cpu cycles or MIPS of complex
> PD-objects like convolve~ oder earplug~? Surely  its possible to
> calculate this from the source code too - for every hint I’ll be
> glad.


You can't determine CPU cycles without measuring in the real world - 
lots of issues out of the control of the source code and compiler might 
affect timing (eg: cache stalls due to OS-controlled switching between 
cores on a multiprocessor system).


Pd has a load meter patch accessible from the menu, but that measures 
all of Pd, rahter than specific objects.


I knocked together the attached external, rough usage guide:


      [unmeausred]
        |    |  \
[cputime~]  |   \
   |    |    |    \
   |  [measured] [???]]
   |    |    |    /
[cputime~]  |   /
   |    |    |  /
   |  [unmeasured]
   |
   |
CPU time taken by [measured]
(in ms, semi-arbitrary maximum 1 minute per block)


[???] might be included in the time, maybe not (depends on the weather) 
- you really need to read and understand the order of execution section 
of the html manual to make use of this [cputime~] properly.


See the help patch for a more in-depth example measuring multiple things.


Consider it under the same license as Pd.


Claude
-- 
http://mathr.co.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cputime~.c
Type: text/x-csrc
Size: 2582 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150329/7a0d9f0a/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cputime~-help.pd
Type: text/x-puredata
Size: 10891 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150329/7a0d9f0a/attachment-0001.bin>
-------------- next part --------------
cputime~.pd_linux: cputime~.c
	gcc -Wall -Wextra -shared -fPIC -O3 -o cputime~.pd_linux cputime~.c


More information about the Pd-list mailing list