I did a little test to figure out why updating the pd gui causes so much CPU activity on OSX. The test consists of four groups of metro, random, and some number boxes placed around the patcher window. To run the test, you need to run the patch and a little app called Quartz Debug, which is part of the Developer Tools (it's in /Developer/Applications/). This fantastic tool shows which parts of the screen are updated by flashing the area as a colored box.
In the Quartz Debug window, check the box next to 'Flash identical updates' for this test. Open the patch and start the first number box in the upper left spinning - you will see the number box flashing red as it updates. Now stop that one and go to the middle set of objects and start the metro - notice that there is a red rectangle connecting the two number boxes as they update. Next go to the objects in the upper right and repeat the test - don't do this if you are epileptic!! At this point, you might be thinking, it's the patch cord connecting them that's the problem. Well start the metro in the top left and the bottom right and witness the wrath of Quartz Debug! Run the tests again with top open and see how much CPU is being drained.
Ok what does the red box and the test really mean? It shows that there is a huge amount of wasted cycles updating part of the gui that doesn't need updating. I don't really know where this inefficiency comes from - it could be tcl/tk* or the way pd uses tcl/tk or ???. Maybe someone with more knowledge can have a look into this, and figure out what's going on, or at least give me a hint where to look.
*My suspicion is that it's tcl/tk at fault here. Incidentally, the WishShell spends most of it's time converting RGB pixels to ARGB while the huge red rects are being updated. Seems truly wasteful.
cgc
here's the patch
#N canvas 354 70 833 695 10; #X floatatom 754 6 5 0 0; #X floatatom 18 610 5 0 0; #X floatatom 19 16 5 0 0; #X floatatom 332 17 5 0 0; #X floatatom 332 270 5 0 0; #X obj 19 -27 metro 10; #X obj 19 -5 random 100; #X obj 19 -47 tgl 15 0 empty empty empty 0 -6 32 8 -262144 -1 -1 0 1; #X obj 332 -31 metro 10; #X obj 332 -6 random 100; #X obj 332 -50 tgl 15 0 empty empty empty 0 -6 32 8 -262144 -1 -1 0 1; #X obj 754 -36 metro 10; #X obj 754 -14 random 100; #X obj 754 -58 tgl 15 0 empty empty empty 0 -6 32 8 -262144 -1 -1 0 1; #X floatatom 734 598 5 0 0; #X obj 734 555 metro 10; #X obj 734 577 random 100; #X obj 734 535 tgl 15 0 empty empty empty 0 -6 32 8 -262144 -1 -1 0 1; #X text 129 -30 <--try this one first; #X text 420 -32 <--then this one; #X text 619 -37 now this one -->; #X text 460 598 now try the first one and this one -->; #X connect 0 0 1 0; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 6 0 2 0; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 9 0 3 0; #X connect 10 0 8 0; #X connect 11 0 12 0; #X connect 12 0 0 0; #X connect 13 0 11 0; #X connect 15 0 16 0; #X connect 16 0 14 0; #X connect 17 0 15 0;