Flash & AS3 info, source, & experiments
mouseEnabled and mouseChildren Affect CPU Load
I was reading a post from Keith Peters today and noticed a comment made by Ryan Taylor mentioning that mouseEnabled and mouseChildren affect the CPU load. I had to know if this was true or not so I promptly created an experiment app. The app randomly creates 700 parent sprites and 700 nested children sprites. You press the SPACE bar to toggle .mouseEnabled and .mouseChildren for all of the objects.
I couldn’t believe it. Although disabling these properties did not seem to affect the FPS, it definitely affected my CPU. When tested on my WinXP,SP2 machine with a P4 3.4 HT CPU, the swf was taking 13-16% of my CPU. When I set mouseEnabled and mouseChildren = false, the CPU load dropped to 4-6% total! It cut down the CPU usage by about 300%! Very good to know. Thanks for the tip Ryan!
| Print article | This entry was posted by Nate Chatellier on March 11, 2008 at 11:29 am, and is filed under ActionScript, Experiments, Flash. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 3 years ago
Confirmed that’s pretty sick and good to know, thanks for the demo.
about 3 years ago
FPS stayed roughly the same, but CPU usage went from ~50% to ~10%!
about 3 years ago
also
Number is faster then uint…. dont remember where I read this.
Btw good article. \
about 3 years ago
here on my HP dv3667nr (turion x2 1.9 64 bits, 2gb ram, flashplayer 10, firefox, windows vista)
~8% enabled ~1%disabled