Earlier I wrote about the speed of rendering in flash and about cacheAsBitmap in particular.
But now I faced a specific question - what is faster - set cacheAsBitmap = true, or translate the image into a raster and load it as a PNG. Provided that the picture is static, but very heavily loaded with different gradients and other things.
To solve the problem, I sketched a small test . ')
Conditions.
There is a certain game scene loaded with moving objects.
Over it, static interface elements are displayed with a bunch of radial gradients, curves, alphas, etc. (It is worth noting that the alphas do not go beyond the clip and do not require mixing with the main stage)
In the test, we change the way we draw only static interface elements. Moving dynamic just mimic the load.
Results.
vector, without cache: 33 fps
cache as bitmap: 46 fps
png: 46 fps
disabled picture: 46 fps
Conclusion.
The conclusion is simple - you can safely use cacheAsBitmap and not be afraid of a performance drawdown.
Moreover, a picture with cacheAsBitmap is so quickly displayed on the screen that the speed does not differ from the option when this picture is not displayed at all.
One need only remember that cacheAsBitmap will not work in the following cases: