[SOLVED] Why does Flash use double the CPU when doubling the screen size?

niccosw

  • Posts: 91
This is probably more of a general Flash question than a specific Stencyl question.

I've been testing my game with a large screen size and my computer started overheating! I checked my CPU and it was at 65 - 70% when testing with the standalone player. I experimented by turning my behaviors on and off, but the most effective strategy was to decrease my screen size.

Try it yourself:

1) Load the Action Adventure kit. Test it and check your CPU (mine was 30-35%)
http://i.imgur.com/1iSD7.png
2) Go into game settings and double the size of the screen (640x416 to 1280x832)
3) Test it. Even with 3/4ths of the screen size blank the CPU load will double (mine was 65-70%)
http://i.imgur.com/POTER.png

I did the same thing with a couple Flashpunk builds and the same thing happened:
Simple Demo: 13% at 800x600 vs. 20% at 1600x1200.
Complex Demo: 20% at 624x480 vs 60%! at 1248x960.

I tried it in Flex, but didn't get the same CPU increase. Is this a Flash issue or a Bitmap engine issue?

« Last Edit: June 24, 2011, 08:16:18 pm by niccosw »

Hectate

  • *
  • Posts: 4645
Flash doesn't have hardware acceleration yet for the approach that is being used here. The CPU isn't getting ANY help from the GPU chipset to render all that screen space - which is normally what the GPU does. So, in addition to everything else that the CPU is handling, now it's got to do graphics stuff too. Lots of load there.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

niccosw

  • Posts: 91
Loading what? There is nothing added except black pixels that never change.

dineyin

  • Posts: 110
He means processing load, not that it's actually loading anything. Simply refreshing a window and filling it with pixels (even if they're all black) takes processing power, and if it's trying to do that 60 times a second it takes quite a bit of work for the processor.

Also "Doubling" the screen size is actually 4 times the number of pixels because you're doubling in two directions (which means it's 4 times the amount of processing)

niccosw

  • Posts: 91
I know that doubling the height and width of a square creates an area four times as large (hence 3/4), but thanks for the elementary geometry tip.  ::)

OK, I guess the culprit here is the 60 frames per second. I've played HD full screen flash games with less CPU load but I suspect that their frame rate was lowered accordingly. Thanks for setting me straight. ;)