Содержание
- 2. Performance-Tuning Mobile Flex Applications Performance Metrics General Tips Item Renderers Views Performance Optimizations in Flex 4.6
- 3. Performance Metrics
- 4. Performance Metrics Metrics Types of Execution Time Frame rate (fps) Startup / validation time Memory SWF
- 5. Where is Time Spent? Effects, Scrolling, Transitions Startup, Navigation, Data processing Critical Areas: Object Creation, Measurement/Layout,
- 6. General Tips
- 7. Rules of Thumb Use the best component for the job Cache and queue external content Set
- 8. Spark Image and BitmapImage Tips BitmapImage vs Image Caching and Queuing (New in Flex 4.5) ContentCache
- 9. Text Components Label - light Single-styled Recommended for static text (mobile & desktop) Used by DefaultItemRenderer
- 10. Spark Text Components StyleableTextField (New in Flex 4.5) Mobile support for edit and selection (turn off
- 11. ItemRenderers
- 12. ItemRenderers in Spark Creating ItemRenderers in MXML is quick and simple Avoid creating heavy ItemRenderers Don’t
- 13. Optimizing MXML ItemRenderer
- 14. Optimizing MXML ItemRenderer top="0" bottom="0" gap="10”>
- 15. MXML ItemRenderer, Baseline Numbers
- 16. Replacing RichText with Label
- 17. Replacing RichText with Label
- 18. Adding ContentCache import spark.core.ContentCache; static public const s_cache:ContentCache = new ContentCache(); ]]> contentLoader="{s_cache}"/>
- 19. Adding ContentCache
- 20. Set “cacheAsBitmap” on the Decorator ... ]]>
- 21. Set “cacheAsBitmap” on the Decorator
- 22. cacheAsBitmap + opaqueBackground on the ItemRenderer ... ]]>
- 23. cacheAsBitmap + opaqueBackground on the ItemRenderer
- 24. IconItemRenderer and LabelItemRenderer Optimized for Mobile Use StylableTextField Lightweight layout Add more sophisticated ContentCache management Configurable
- 25. IconItemRenderer messageField="name" iconField="graphic" iconWidth="48" iconHeight="48" decorator="{assets.Chevron}"> import assets.Chevron; ]]>
- 26. IconItemRenderer
- 27. Views
- 28. Views Creating Views in MXML is quick and simple Avoid creating heavy Views Don’t use unnecessarily
- 29. Sample View
- 30. Baseline Results 1094 pushView() elementAdd updateComplete viewActivate
- 31. Deferred Instantiation Don’t create objects until needed visible.portrait="false" includeInLayout.portrait="false"> ... includeIn="landscape"> ...
- 32. Results 1094 670 (39%)
- 33. Convert Image to BitmapImage Spark Image SkinnableComponent Customizable loading state Customizable “error” (broken image) state BitmapImage
- 34. Using ContentCache import spark.core.ContentCache; [Bindable] static protected var s_c:ContentCache = new ContentCache(); ]]> ...
- 35. Results 1094 670 (39%) 527 (21%)
- 36. BorderContainer BorderContainer is not optimized for mobile Instead use a Group with a Rect
- 37. Minimize Nested Groups Sometimes unnecessary nesting is easy to remove
- 38. Using ConstraintLayout Instead of Nested Groups Consider using ConstraintLayout instead of nested VGroup and HGroup
- 39. Using ConstraintLayout Instead of Nested Groups
- 40. Using ConstraintLayout Instead of Nested Groups left="bmpColumn:1" right="bmpColumn:1" top="1" bottom="1"/>
- 41. Results 451 (15%) 1094 670 (39%) 527 (21%)
- 42. Convert GraphicElements to FXG GraphicElements Lightweight graphic primitives FXG Static compile-time optimized graphics
- 43. xmlns:s="library://ns.adobe.com/flex/spark"> Example of MXML GraphicElements
- 44. Example of Compiler Optimized FXG xmlns:assets="*"> text="Hello World" x="150" /> MyGraphic.fxg:
- 45. Results 451 (15%) 378 (16%) 1094 670 (39%) 527 (21%)
- 46. Convert FXG to PNG Consider converting complicated FXG shapes to bitmaps Reduce rendering time Lose scaling
- 47. Results 348 (8%) 451 (15%) 378 (16%) 1094 670 (39%) 527 (21%)
- 48. Results
- 49. Performance Optimizations in Flex 4.6
- 50. Scroller On demand scrollbars Scrollbar skin parts are now factory parts Created when touch interaction starts
- 51. itemRendererFunction Recycles! Tip: Only create one ClassFactory per item renderer class private function badIRFunction(item:Object):ClassFactory { if
- 52. 32-bit Rendering in Android 32-bit rendering enables better color rendering, Stage3D, StageVideo 16-bit rendering has better
- 54. Скачать презентацию