Flash 10 Speed Test: copyPixel vs. Scrolling Sprite vs. Scrolling MovieClip
When Flash introduced the copyPixel operation a few versions ago, I was very excited. Finally, I could create blazing fast games that worked more like “real” games instead of using MovieClips. However, copyPixel is no magic bullet.
Here are the results of a simple test where I scroll a background image. I guessed that copyPixel would yield the fastest results, but I was wrong.
Note that during initial testing it was difficult to get a big difference with an 800×600 drawing area.
Of course, that’s because I’m only moving 1 image around as opposed to hundreds as in an actual game.
Thus, to make the differences stand way out, I increased the drawing area to 1880×1024.
This will fill up Fire Fox if your resolution is 1920×1200, but you can still see the drawing area.
The frame rate is set to 120.
Note also that I am using a crazy big image of size 4095×4095 (3.5 Megs).
Various OSs and Browsers
| # | Method | Mode | Fps Fire Fox - Win | Fps Internet Explorer - Win | Fps Fire Fox - Mac |
| 1 | Copy Pixel | opaque | 21-23 | 36-38 | 36-37 |
| 2 | Copy Pixel | window | 40-42 | 43-45 | 36-36 |
| 3 | Copy Pixel | direct | 54-56 | 46-48 | 30-31 |
| 4 | Copy Pixel | gpu | 27-28 (wtf?) | 43-45 | 21-22 |
| 5 | Sprite | opaque | 24-25 | 36-37 | 36-37 |
| 6 | Sprite | window | 58-60 | 62-64 | 36-37 |
| 7 | Sprite | direct | 80-84 | 58-60 | 35-36 |
| 8 | Sprite | gpu | 120 solid (wow) | 61-63 | 33 |
| 9 | MovieClip | opaque | 24-25 | 38-40 | 36-38 |
| 10 | MovieClip | window | 58-60 | 55-62 | 36-37 |
| 11 | MovieClip | direct | 80-83 | 58-60 | 36 |
| 12 | MovieClip | gpu | 120 solid (wow) | 58-62 | 33 |
So, the really confusing thing for me is that copy pixel seems to drag down gpu mode!
Also, remember when “opaque” used to be the best wmode option for performance? Not any more (at least for this specific test).
Recent Comments