I posted this to the Adobe forums but I don't expect a good answer there. I am looking for help from someone who has done a game in flash and has encountered the same problem.
Steps to reproduce my problem:
Create simple dot DisplayObject in flash
dot.graphics.beginFill( color); dot.graphics.drawCircle( 0, 0, 2 ); dot.graphics.endFill();
Draw dot to bitmap many times a frame
bitmapData.draw( dot, null, null, "normal", null, _smoothing );
- Test FrameRate in combination of browsers,flash plugin versions on Win32
Expect:
Framerate to be close in most cases
Observed:
I am seeing a 25% decrease in framerate under IE7 using Flash10b.ocx(10.0.22) and 50% decrease in framerate using Flash10c.ocx(10.0.32). PLugins under FireFox, Safari and in Mac OSX don't exhibit the same slowdown.
Help please:
I would like to get help/confirmation on a performance problem that I see in Internet Explorer. The Adobe and Flash community is great on the Internet but I have been surprised to see no information on this, just a few reports about movie playback on 10.0.32 vs. 10.0.22.
My guess is that in IE flash plugin is passing draw calls to Win32 and that this is slow.
My solution is:
Instead of drawing each time on the bitmap using draw, cache the draw calls to a bitmap and use CopyPixels
. When I do this the performance is the same across browsers, within 10%.
bitmapData.copyPixels(dot.bitmapData,dot.bitmapData.rect,new Point(dot.x,dot.y),null,null,true);
Loop I am using:
function enterFrame(e:Event) {
bitmap.lock();
for (var i:int=0;i<particles.length;i++) {
draw(particle[i]);
}
bitmap.unlock();
}
Notes about other possibly "known" issues I would like to know more about:
- Under IE the memory use for my application is reported to be much smaller (33MB typically in flashplayer, 16MB under IE).
- Under IE the memory page faults are at over 10k/sec whereas in the flash player there are none.
- Under IE the stage.invalidate seems to cause performance hitching problems.
- Under IE the putting a blur filter on the bitmap has bigger performance hit that in the flash player.