Tuesday, April 26, 2011

animation / graphics

The priority I gave these are based on my observations of what most commonly degrades the performance of an application. The most processor intensive part of an application is the animation and graphics, hands down. Fortunately, the graphics are one of the easiest places to improve.

  • Use runtime filters sparingly. If you can turn it into a raster graphic with those filters, it will likely be a smoother animation. This will be a delicate balance between file size and performance.
  • Use motion tweens instead of shape tweens whenever possible.
  • Don't have transparent things on top of transparent things. When transparencies overlap, the processor usage multiplies.
  • Keep your frames per second at or below 30. I've seen many applications trying to run at 60+ fps. I usually set my applications at around 24.
  • Use easing only where you need it.
  • Learn about cacheAsBitmap. This can speed things up or make them slower, it depends on the context. If you have an animation, keep cacheAsBitmap as false, the cached bitmap will have to be regenerated every time the animation changes, so this isn't worth it. However, on a vector graphic that doesn't change within itself, cacheAsBitmap might be a good choice.

No comments:

Post a Comment