© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Performance-Tuning Mobile Flex Applications Evtim Georgiev Computer Scientist,

Slides:



Advertisements
Similar presentations
Drawing, Skinning and Degrafa This presentation covers drawing, skinning and the use of Degrafa to make things easier. Understanding the basics of drawing.
Advertisements

How to Avoid a Power Point Disaster For Projects, Oral Defense and Symposia Created by Alicia Wargowsky & Christen Rae Revised by Julie Sanchez Fall 2010.
Adobe Flex as RIA Adobe Flex as RIA Developed by Sagar K Developing Rich Internet Applications with Adobe Flex, ActionScript.
Web Performance Meetup 1 Web Performance 101 Jeremy
White Master Replace with a graphic 5.5 Tall &4.3 Wide Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.1 Matt May
INTRODUCTION TO ADOBE FLASH CS4
Slice and Dice: From PSD Image to XHTML+CSS Svetlin Nakov Telerik Corporation
HTML Tags and Their Functions
V1.01 Embracing the Mobile Frontier and Reaching the Digital Natives Jonathan
Introduction to XNA on Windows Phone 7 SILVERLIGHTSHOW.NET Webinar Peter Kuhn, June 30 th, 2011.
Introducing Macromedia Flash MX 2004 – Lesson 11 Introducing Macromedia Flash MX 2004 Lesson 1.
WEB PAGE AUTHORING WITH EXPRESSION WEB. What is the overall procedure for creating a web site?
© 2010 Delmar, Cengage Learning Chapter 7: Importing and Modifying Graphics.
Lab 10: Images and Skinning, Sound and Assets User Interface Lab: GUI Lab Oct. 30 th, 2013.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
DBSYSTEMS 1 of 23 Chapter 6 DB System Development: Forms and Reports 1 Based on G. Post, DBMS: Designing & Building Business Applications University of.
Chapter 6 Preparing and Publishing Applications. Chapter 6 Lessons 1.Publish movies 2.Reduce file size to optimize a movie 3.Create a preloader 4.Publish.
© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Adobe Acrobat XI Accessibility Features Matt May | Accessibility Evangelist.
20 x Tips to better Optimize your Flash
Flex 4 - Spark Containers Ryan Frishberg Software Consultant, Lab49
© 2011 Adobe Systems Incorporated. All Rights Reserved. Flex Performance Tips & Tricks Evtim Georgiev | Computer Scientist, Flex SDK |
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Kiran Kaja | Accessibility Engineer Ensuring Accessibility in Document Conversion.
Web Clipping Presentation By: Alex Jacobs, Philip Kim, Nathan Po Web Clipping.
1 Flash and Animation Presented by : Behzad Sajed Khosrowshahi.
 jQuery Mobile An Introduction. What is jQuery Mobile  A framework built on top of jQuery, used for creating mobile web applications  Designed to make.
Paul Trani Adobe Certified Instructor/Expert Resources:
MDCFUG TeraTech, Inc Adobe Flash 9 By Michael Smith TeraTech.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
‘ {] Chapter 2 (HW01) Getting Started with Windows 7.
What’s new in Fireworks 8 Optimization Integrated workflow Create without complexity Workflow Improvements.
Apple Iphone Woubshet Nema Bethelhem Tadele.  This is a presentation about AppleIphoneguidelines  Woubshet Nema  Bethelhem.
Using Flash & Flex Together Jesse R. Warden Flex, Flash, & Flash Lite Consultant Universal Mind Blog:
Developing Better PhoneGap Apps Session 608 / DevLearn 2013 Daniel Pfeiffer Lead Developer / Float Mobile Learning.
Chapter 2 Developing a Web Page. A web page is composed of two distinct sections: –The head content –The body Creating Head Content and Setting Page Properties.
Tutorial 6 Working with Bitmaps and Gradients, and Publishing Flash Files.
1 SEG3120 Analysis and Design for User Interfaces Flash Anis Zarrad Parallel Simulations and Distributed Systems (PARADISE) Research Laboratory SITE, University.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® INTRODUCTION TO FLASH ANIMATION.
® Copyright 2010 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH PROFESSIONAL CS5.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 Flex architectural patterns James Ward Technical Evangelist
® Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential.1 Moving from Flex 3 to Flex 4 The Good, the Bad, and the Ugly… Joan.
Creating a Usable Web Site Royce Shin - Web Development University of Minnesota.
PowerBuilder Online Courses - by Prasad Bodepudi
Flash Adobe Flash Introduction Kyungeun Park. Bitmap vs. Vector based  Bitmap –Bitmaps are made up of single pixels  Vector based –Vector graphics are.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. word 2010 Chapter 3 Formatting Documents.
Introduction to Web Page Design. General Design Tips.
Esri UC 2014 | Technical Workshop | Python Map Automation – Beyond the Basics of arcpy.mapping Jeff Barrette Jeff Moulds.
HTML tags Some popular ones. Paragraph: separated by a single line of white space Line break NOTE: no end tag is used for this tag Headlines ( through.
Building cool web applications with Flex Presenters Joseph Khan Rasmiranjan Nayak.
Flex 2 We’re Not in Kansas Anymore! or Welcome to Flex Theo Rushin Jr TeraTech, Inc.
Adobe/Macromedia Fireworks JAOIT 8. Fireworks – what is it? Adobe Fireworks (formerly Macromedia Fireworks) is a bitmap and vector graphics editor. It.
1 A Basic Introduction to Flash. Outline What is a flash? Macromedia Flash MX 2004 Flash concepts Flash Demos Conclusion Additional help 2.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 Flex for Flash Developers Sho Kuwamoto Sr. Director, Engineering Adobe Systems, Inc.
® Copyright 2008 Adobe Systems Incorporated. All rights reserved. Creating New Components in Flex 3 and Beyond Deepa Subramaniam Flex SDK
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Adobe Flash Professional CS5 – Illustrated Unit E: Optimizing and Publishing a Movie.
Efficient Game Graphics From Flash MX 2004 Game Design Demystified.
5/2/2018 1:53 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS.
Working with Data Blocks and Frames
Introduction to Computer CC111
Introduction to the Visual C# 2005 Express Edition IDE
Microsoft® Office Word 2007 Training
Chapter 2 – Introduction to the Visual Studio .NET IDE
Interface Programming 2 Week 1
INTRODUCTION TO FLASH ANIMATION
What language other than MXML you can use for writing a Flex Application.
Presentation transcript:

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Performance-Tuning Mobile Flex Applications Evtim Georgiev Computer Scientist, Flex SDK Steve Shongrunden Computer Scientist, Flex SDK

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Performance-Tuning Mobile Flex Applications Performance Metrics General Tips Item Renderers Views Performance Optimizations in Flex 4.6 Q & A

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Performance Metrics

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Performance Metrics Metrics Types of Execution Time Frame rate (fps) Startup / validation time Memory SWF Size 4

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Where is Time Spent? 5 Effects, Scrolling, Transitions Startup, Navigation, Data processing Critical Areas: Object Creation, Measurement/Layout, Render

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. General Tips

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Rules of Thumb Use the best component for the job Cache and queue external content Set cacheAsBitmap on graphics that change infrequently but redraw often Minimize nested containers

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Spark Image and BitmapImage Tips BitmapImage vs Image Caching and Queuing (New in Flex 4.5) ContentCache class Cache on by default Queue off by default contentLoader property on Spark Image, BitmapImage IContentLoader interface Use PNG instead of GIF/JPEG Avoid large images for small icons

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Text Components Label - light Single-styled Recommended for static text (mobile & desktop) Used by DefaultItemRenderer (desktop) RichText - heavier Multi-styled RichEditableText - heaviest Selection, edit Used by TextInput and TextArea (desktop) 9

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Spark Text Components StyleableTextField (New in Flex 4.5) Mobile support for edit and selection (turn off if not needed!) Used by LabelItemRenderer & IconItemRenderer (mobile) Cant use directly in MXML StyleableStageText (New in Flex 4.6) Native OS text control Responsive editing Really fast scrolling Used by TextInput and TextArea (mobile) Cant use directly in MXML

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. ItemRenderers

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. ItemRenderers in Spark Creating ItemRenderers in MXML is quick and simple Avoid creating heavy ItemRenderers Dont use heavy (text) components Cache and queue external content requests Use cacheAsBitmap (carefully!) Turn off autoDrawBackground if not needed Avoid Filters / drop shadows Avoid complex binding expressions Reduce number of nested Groups Use the mobile-optimized IconItemRenderer and LabelItemRenderer

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Optimizing MXML ItemRenderer 13

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Optimizing MXML ItemRenderer <s:HGroup verticalAlign="middle" left="15" right="15" top="0" bottom="0" gap="10>

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. MXML ItemRenderer, Baseline Numbers

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Replacing RichText with Label

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Replacing RichText with Label

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Adding ContentCache <![CDATA[ import spark.core.ContentCache; static public const s_cache:ContentCache = new ContentCache(); ]]> <s:Rect... <s:Line... <s:BitmapImage id="icon" source="{data.graphic} contentLoader="{s_cache}"/>

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Adding ContentCache

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Set cacheAsBitmap on the Decorator <![CDATA[... ]]> <s:Rect... <s:Line...

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Set cacheAsBitmap on the Decorator

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. cacheAsBitmap + opaqueBackground on the ItemRenderer <![CDATA[... ]]> <s:Rect... <s:Line...

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. cacheAsBitmap + opaqueBackground on the ItemRenderer

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. IconItemRenderer and LabelItemRenderer Optimized for Mobile Use StylableTextField Lightweight layout Add more sophisticated ContentCache management Configurable Use styles, properties to control the layout, text, etc. Extensible Subclass to tweak layout, parts, etc. Tip: Create parts on demand

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. IconItemRenderer <s:IconItemRenderer labelField="callLetters" messageField="name" iconField="graphic" iconWidth="48" iconHeight="48" decorator="{assets.Chevron}"> <![CDATA[ import assets.Chevron; ]]>

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. IconItemRenderer

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Views

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Views Creating Views in MXML is quick and simple Avoid creating heavy Views Dont use unnecessarily heavy (text) components Defer object creation Use BitmapImage instead of Image Cache and queue external content requests Use Group instead of BorderContainer Reduce nested containers Use mobile optimized component skins

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Sample View

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Baseline Results 1094 pushView() elementAdd updateCompleteviewActivate

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Deferred Instantiation Dont create objects until needed <s:Group id="helpView" height="100%" visible.portrait="false" includeInLayout.portrait="false" >... <s:Group id="helpView" height="100%" includeIn="landscape" >...

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Results (39%)

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Convert Image to BitmapImage Spark Image SkinnableComponent Customizable loading state Customizable error (broken image) state BitmapImage Lightweight GraphicElement Cache images that are used frequently

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Using ContentCache <![CDATA[ import spark.core.ContentCache; [Bindable] static protected var s_c:ContentCache = new ContentCache(); ]]>...

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Results (39%) 527 (21%)

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. BorderContainer BorderContainer is not optimized for mobile Instead use a Group with a Rect

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Minimize Nested Groups Sometimes unnecessary nesting is easy to remove

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Using ConstraintLayout Instead of Nested Groups Consider using ConstraintLayout instead of nested VGroup and HGroup

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Using ConstraintLayout Instead of Nested Groups

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Using ConstraintLayout Instead of Nested Groups <s:BitmapImage... left="bmpColumn:1" right="bmpColumn:1" top="1" bottom="1"/>

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Results 451 (15%) (39%) 527 (21%)

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Convert GraphicElements to FXG GraphicElements Lightweight graphic primitives FXG Static compile-time optimized graphics 42

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. <s:Application xmlns:fx=" xmlns:s="library://ns.adobe.com/flex/spark"> Example of MXML GraphicElements

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Example of Compiler Optimized FXG <s:Application... xmlns:assets="*"> <s:Button text="Hello World" x="150" /> MyGraphic.fxg:

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Results 451 (15%) 378 (16%) (39%) 527 (21%)

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Convert FXG to PNG Consider converting complicated FXG shapes to bitmaps Reduce rendering time Lose scaling fidelity 46

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Results 348 (8%) 451 (15%) 378 (16%) (39%) 527 (21%)

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Results

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Performance Optimizations in Flex 4.6

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Scroller On demand scrollbars Scrollbar skin parts are now factory parts Created when touch interaction starts Up to 15% faster for simple List views Tip: Update custom Scroller skins Tip: Use Scroller.viewport instead of Scroller.verticalScrollBar trace(myScroller.verticalScrollBar.value); trace(myScroller.viewport.verticalScrollPosition);

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. itemRendererFunction Recycles! Tip: Only create one ClassFactory per item renderer class private function badIRFunction(item:Object):ClassFactory { if (Number(item) % 2 == 0) return new ClassFactory(RedRenderer); else return new ClassFactory(BlueRenderer); } private var red:ClassFactory = new ClassFactory(RedRenderer); private var blue:ClassFactory = new ClassFactory(BlueRenderer); private function goodIRFunction(item:Object):ClassFactory { if (Number(item) % 2 == 0) return red; else return blue; }

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 32-bit Rendering in Android 32-bit rendering enables better color rendering, Stage3D, StageVideo 16-bit rendering has better scrolling performance Flash Builder 4.6 will automatically set this to 16-bit in new projects Existing projects should be updated <![CDATA[... ]]> 16bit

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. More Resources Blogs Evtim – Steve – Best Practices for Building Flex Tablet Applications – Glenn Ruehle, Flex SDK Flex Performance Tips & Tricks from 360Flex Denver General Performance Tips from Adobe MAX IconItemRenderer and LabelItemRenderer TODO: Are MAX talks being recorded?