This issue has been discussed in the past but I wanted to bring it up again in case someone had figured out what the deal is with disabling debug draw and immediately seeing a drop in performance.
It seems to have something to do with redraw regions (the ones you can view with the right-click menu in the Flash player). If the entire screen is not marked dirty every frame, the framerate of the application slows down. You would think a partial screen update would be more efficient. WTF?
For the record, drawing a stage sized rectangle every frame also seems to get the job done. It can even have zero alpha, like so:
That's what I'm using at the top of my main loop now.
This is still bothering me though as I feel I'm missing something fundamental in how the Flash architecture works.
It seems to have something to do with redraw regions (the ones you can view with the right-click menu in the Flash player). If the entire screen is not marked dirty every frame, the framerate of the application slows down. You would think a partial screen update would be more efficient. WTF?
For the record, drawing a stage sized rectangle every frame also seems to get the job done. It can even have zero alpha, like so:
Code:
graphics.beginFill(0xff000000, 0);
graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
graphics.endFill();
graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
graphics.endFill();
That's what I'm using at the top of my main loop now.
This is still bothering me though as I feel I'm missing something fundamental in how the Flash architecture works.