# Still a significant CPU ratcheting effect when changing PublisherIDs

**tracedwax**May 23, 2011 11:25 AM

Hi Arun, Nigel, & co,

Thanks again for making the bug fixes last week -- seems to have improved the ratcheting issue some.

Running a battery of further tests this morning, I noticed however that the improvement wasn't as much as I'd originally hoped: there was still a large ratcheting effect with a significant impact.

To isolate the problem, I ran your swf again at http://blogs.adobe.com/arunpon/files/2011/05/WebCameraFinalTrace2.swf. My standard test has been to start the app on 4 computers, turn on cameras for the first 3 computers, and take an initial reading of CPU usage. Then I measured the CPU each time I clicked on someone to put them on the larger WebcamSubscriber, then switched once per second between them, in order, ten times each. Then I turned the fourth computer's camera on and measured its CPU usage. I then waited 10 minutes and measured everyone's CPU usage, then switched 10 more times over an additional 30 seconds.

We ran experiments like this multiple times and found noticed significant CPU ratcheting. CPU usage would recover sometimes, but the recovery took a long time. The fourth computer showed no CPU increase until its camera turned on, at which point it showed a very large CPU increase. Putting the fourth computer on the large WebcamSubscriber crashed Flash Player. Waiting for 10 minutes, the CPU hadn't decreased for any of the computers. Repeating the switching, however, the computers' CPU initially decreased by a lot (perhaps garbage collection kicked in), but then increased again as before.

Here are the details. Computer A is a MacBookPro '10 i5 4GB, Computer B is a MacBook '09 CoreDuo 2GB, Computer C is a MacBook Pro '10 i7 8GB, and Computer D is a '07 MacBook Pro CoreDuo 3GB. They're all Macs, but PCs showed similar ratcheting effects. A, B, and C were running Firefox 4 and D was running Firefox 3, but we've seen similar effects in other browsers.

The numbers below are the CPU percentages of the Flash Player process while running your SWF above that includes your publisherIDs bug fix:

Before starting cams

A - 1.6%

B - 2.1%

C - 2.5%

D - 6.5%

A,B,C start their cams

A - 10%

B - 10%

C - 9%

D - 22%

A is published to big screen

A - 19%

B - 12.5%

C - 12%

D - 33%

B is published to big screen

A - 13.5%

B - 22%

C - 12%

D - 32%

C is published to big screen

A - 14%

B - 13%

C - 19%

D - 32%

Switch between A,B,C 9 times each, such that A is on big screen

A - 36%

B - 17%

C - 24%

D - 33%

Switch to B on the big screen

A - 19%

B - 36%

C - 25%

D - 32%

Switch to C on the big screen

A - 20%

B - 19%

C - 63%

D - 33%

D turns on Cam

A - 26%

B - 24%

C - 64%

D - 113%

D to big screen

A - 26%

B - 24%

C - 37%

D - 125%

Wait 10 minutes, D freezes, put A on big Screen

A - 28%

B - 17%

C - 20%

put C on big screen

A - 18%

B - 17%

C - 48%

Switch 40 times in 30 seconds, put A on big screen

A - 85%

B - 37%

C - 14%

Put B on big screen

A - 38%

B - 92%

C - 14%

put C on big screen

A - 39%

B - 40%

C - 22%

Thanks very much,

-Trace