Author Topic: flash player 10.1 breaks stuff.. I dont think its the render problem.  (Read 1065 times)

zez

  • Active Member
  • ***
  • Posts: 203
  • Karma: +0/-0
    • View Profile
    • Devlog
So... My current project, on a shoddy laptop from a while back (duel core amd turion @ 803 mhz, 960 megs of ram, running XP service pack 3,) is pretty much unplayable in flash player 10.1, whereas it runs kind of sort of mostly perfectly in 10.0 (I have some of the more system intensive stuff set up to only fire well FlxG.elapsed is < something, so the first thing to go is visual fluff, and it still runs most of it.)
In 10.1 it drops down to around 15 fps, and pretty much becomes unplayable.

I tried modifying FlxSprites advanced render stuff, and basicly just changed buffer.draw(_framePixels, stufffff) into buffer.draw(new Bitmap(_framePixels), that same stuff) and umm... got pretty much zero results. The game does render about twice as fast when I do it that way, but looking at the dev console, I dont really think thats whats breaking it (unless Im doing something totally bassackwards, always a possibility)

Anyhow, heres about the situation;
with "fix"
10.1
42~ ms update
8~ ms render
45~ ms flixel
60~ ms total
15~ fps
cpu - 50% ish
memory - starts at 40 megs, quickly jumps to 75, then rises to about 100 megs, idles there for a second, and then drops down too 75. It does this regardless of advanced rendering.

10.0
9~ ms update
6~ ms render
14 ~ ms flixel
20~ ms total
50~ fps
cpu - 50% ish
memory - 40 - 50 megs, fairly consistent.

without fix
10.1 mostly the same, render is about double when doing advanced rendering, frame rate is still around 15.
cpu - 50% is
memory 75 megs - 100 ish and then back.
10.0 no noticeable difference.
cpu - 50% ish
memory - 31megs - 76 ish and then back.
« Last Edit: Fri, Jul 30, 2010 by zez »

zez

  • Active Member
  • ***
  • Posts: 203
  • Karma: +0/-0
    • View Profile
    • Devlog
So umm... did I implement the fix incorrectly, or do you think somethin else is breaking it? I just want to know where to start on debugging this.

Jon

  • Member
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
    • Stencyl
Isn't it bad to be creating a new Bitmap object each frame?

lithander

  • Active Member
  • ***
  • Posts: 222
  • Karma: +0/-0
    • View Profile
    • pixelpracht
That fix just get's rid of the memory leak. That will improve the performace somewhat but there might be other issues introduced with 10.1 - despite the fix both my project at work and my personal project perform worse in 10.1 then in 10.0. I just haven't found out why, yet.

P.S.: you mustn't create a new Bitmap every frame per Sprite! You can use the same Bitmap to wrap all Sprites and thus implement the fix without any dynamic allocation.
Simplicity is the ultimate sophistication ~Leonardo Da'Vinci

zez

  • Active Member
  • ***
  • Posts: 203
  • Karma: +0/-0
    • View Profile
    • Devlog
how would I go about doing that? When I tried wrap.bitmapdata = pixels; draw(wrap,etcetc); I got more slowdown...