I just attended a session at Adobe Max given by Evtim Georgiev and Steve Shongrunden on performance tuning mobile Flex apps. Since I'm a performance geek, I thought I'd post the tips here
How to optimize your mobile view rendering
How to optimize your mobile view rendering
- Avoid heavy components
- Defer object creation (lazy)
- Use BitmapImage instead of Image
- Use Group (with a Rectangle) instead of BorderContainer
- Reduce nested Groups
- Use mobile optimized component skins
- Use ConstraintLayout instead of nested VGroup and HGroup
- Use cacheAsBitmap on images that don't change often but redraw often
- Avoid a lot of nested containers
- Use ContentCache class for caching server side data - cache on by default, queue off by default
- Use PNG for all images (much faster than jpg/gif)
- Use Label over RichText over RichEditableText (Label is a LOT faster than the other two)
- StyleableTextField (turn off edit and selection if not needed) - This is used by LabelItemRenderer and IconItemRenderer (can't use directly in MXML)
- StyleableStageText - new in 4.6. Use this very responsive editing and scrolling (used by mobile TextINput andTextArea (can't use directly in MXML)
- Create ItemRenderes in MXML. Use mobile-optimized IconItemRendererand LabelItemRenderer
- Avoid creating heavy ItemRenderers (don't use heavy (text) components. Turn off autoDrawBackground if not needed. Avoid Filters/drop shadows.
- Avoid complex binding expressions (i.e. on scrollable content)
- Reduce nested Groups
Some other tidbits: Why are Adobe mobile optimized components better?
- Use StylableTextField (lightweight layout)
- More sophisticated ContentCache
- Their configurable (use styles for properties)
What's coming in Flex 4.6?
- On demand scrollbars (created when touch interaction starts) - up to 15% faster for list based views
- ItemRendererFunction recycles, so now it's mobile friendly
- 32-bit rendering in Android available, but 16-bit rendering is faster
Feel free to add any other tips in the comments below.


0 comments:
Post a Comment