[PD] profiling with Shark WAS Re: performance on osX

Hans-Christoph Steiner hans at eds.org
Fri Nov 23 20:01:26 CET 2007

On Nov 21, 2007, at 5:51 PM, Thomas Grill wrote:

> cyrille henry schrieb:
>> could anyone with a macbook pro could test this patch and tell me  
>> the CPU used?
>> does anyone know why the macbook is so slow?
> Hi, you could use Shark (Apple's profiler) to have a look what exactly
> uses up the cpu.
> greetings, Thomas

Do you have an tips on profiling Pd with Shark?  I just noticed that  
Pd-0.39.3-extended is using 13-14% of my CPU just having it open.  I  
just did a quick naive run of Shark, and this is the most striking  

46.7% of the load at idle is in a narrow area, with 33.5% being  
caused by "find_user_regs":

46.7%	46.7%	mach_kernel	ml_set_interrupts_enabled	
0.0%	36.5%	mach_kernel	 thread_block_reason	
0.0%	36.5%	mach_kernel	  thread_block	
0.0%	33.5%	mach_kernel	   semaphore_wait_internal	
0.0%	33.5%	mach_kernel	    semaphore_timedwait_signal_trap_internal	
0.0%	33.5%	mach_kernel	     semaphore_timedwait_signal_trap	
0.0%	33.5%	mach_kernel	      find_user_regs	
0.0%	3.0%	mach_kernel	   uiomove	
0.0%	3.0%	mach_kernel	    selprocess	
0.0%	3.0%	mach_kernel	     select	
0.0%	3.0%	mach_kernel	      unix_syscall	
0.0%	3.8%	mach_kernel	 thread_invoke	
0.0%	3.6%	mach_kernel	  thread_run	

It seems that Max/MSP also can have this problem:


You can see that the Tcl/Tk GUI is not the problem at all.  It's a  
separate process (MacOS/Pd-extended vs Resources/Scripts/../bin/pd ),  
and here it's using 0.0% of the CPU:

hans at palatschinken.local:tkwidgets > ps auxwww | grep '[P]d'
15.0 -0.7   420424  15364  ??  S     1:40PM   0:30.37 /Applications/ 
Pd-extended.app/Contents/Resources/Scripts/../bin/pd -guiport 5600
  0.0 -0.5   372052  10692  ??  S     1:40PM   0:01.58 /Applications/ 
Pd-extended.app/Contents/MacOS/Pd-extended -psn_0_36438017

As for Tcl/Tk versions, Pd-0.39.3-extended is using something around  
8.4.15, while the nightly builds are using basically the newest in  
CVS from "core-8-4-branch".



You can't steal a gift. Bird gave the world his music, and if you can  
hear it, you can have it. - Dizzy Gillespie

More information about the Pd-list mailing list