3 ms·
Thanks for that example, it's been mentioned several times that the Flash technology isn't the only cause of the CPU being pegged but the code that banner devel
by sosuke 16y ago
Thanks for that example, it's been mentioned several times that the Flash technology isn't the only cause of the CPU being pegged but the code that banner developers are writing as well and now I've got a good sample to share.
98% CPU usage when the tab is active.
I've got an iMac, 2.66 GHz Intel Core 2 Duo with 4GM RAM
When the tab is active the CPU usage for Firefox is at 98%, when it isn't the active tab it goes down to 12%, that is interesting. I wonder if Flash stops on inactive tabs currently. I know you can program for that functionality but is it in there by default now?
- cjbos 16y agoThis is how flash player now works, with the latest release it drops the frame rate of the flash movie to something like 2-3 frames per second if the movie is not visible in the browser. Flash player is also single threaded so executes code on a single cpu core, but it does rendering using multiple cores. If you are seeing a single core spike to 100% usage then it is a sign of badly coded actionscript (onFrameEnter event handlers are very popular with designers who cut and paste as2 code), if you are seeing multiple cores at around 100% then it is a rendering issue, i.e. trying to redraw the entire stage every frame and/or a very high frame rate (> 30 fps). I'm not sure if code attached to the frame in the Flash IDE would also cause multiple cores to spike, or if this also executes in the single threaded cycle. But again, having actionscript inside the .fla instead of separate .as files is a sign of a poorly designed/developed flash application.