SlideShare a Scribd company logo
20 x Tips to better
Optimize your Flash
     content
         @EladElrom
#1: Flash Player 10.1
“out of the box” optimization


• Instance Management

• Screensaver Mode
  NativeApplication.nativeApplication.systemI
  dleMode = SystemIdleMode.KEEP_AWAKE;

• GPU Hardware Acceleration
        allows bitmap blitting
        stops using software (CPU) rendering altogether
#2: Profiling ur App
• • Open Source Benchmark
  • Flash BuilderProfiler - Tools Rate
  Flash Benchmark 4.1 System
     FlexUnit 8: - Profiler
     Profiling withMonitor Frame
• • FrameStats Benchmark AS3
  Grant Skinner’s
  http://www.kongregate.com/games/SnailsAnimation/flash-benchmark-08
     http://jpauclair.net/flashpreloadprofiler/
  or http://www.timo-ernst.net/misc/riabench-start/
#2: Profiling ur App


• OHHH…. I almost forgot!!!
• you can just do: getSize
  to find out the memory size of an object
#3: Architecting

• Micro-architecture frameworks?
Tip #4: I/O



•••StrongRTMP.the data with AMF on client and
   AMF, lazy loading James Ward’s tool to
    Use type Use whenever possible.
   server side to increase performance.
   benchmark and see the memory difference:
   http://www.jamesward.com/census/.
Tip #5: Manipulating swf Framerate

• Reducing fps when your app is inactive
• Increase the fps once the app is active again
https://github.com/EladElrom/Flash-Optimizing-Tools

• Increase fps while animation is playing to
framerateManager:FrameRateOptimizer =
   create a morenew FrameRateOptimizer(and keeping
                    smooth experience this, true );
   a stack of all the animations being played to
   know when we can drop the fps.
• Provide a cross platform API (Pure
   AS3, Flex, AIR)
Tip #6: Reduce memory usage

Memory leaks due to listeners that have been set by us or
someone else and never removed from memory:

Solution: Listeners API

movieClip.addEventListener( listeners.type =
MouseEvent.CLICK, listeners.handler = onClick );

movieClip.addEventListener( listeners.type =
MouseEvent.DOUBLE_CLICK, listeners.handler = onDoubleClick );

listeners.removeAllListeners( movieClip );
Tip #7: Avoid memory leaks

Call gc twice, or in AIR system.gc(): Ensure GC
  will do his job correctly:
• Set weekly references - where possible:
  addEventListeners and Dictionary classes.
• Don’t keep references - nulling objects with
  events don’t unhook them.
Tip #8: Update screen
                 once per frame
Elastic Racetrack
• Frame starts - Event.ENTER_FRAME
• Frame actions executed - Event.FRAME_CONSTRUCTED
    • Avoid using updateAfterEvent,
• End of Frame cycle - Event.EXIT_FRAME since it
• Pre-render phasePlayer- and increases the player
    interrupt the starts Event.RENDER
• Final user code is executed
    work load.
• Player renders changes to display own using the
    • Handle invalidation on your
• Cycle completed
   stage.invalidate() property
Tip #9: Decrease nesting
Tip #10: Reduce complexity
• Shape level classes such as
• TextField
• Constructor code of children executed: 68
  Use low
  Constructor code of children executed: 276
  Player renders changes display list: possible) over
  TextField, SimpleButton (when 168
• mx:Text Spark. It will require more coding but
• haloimprove performance.
  Spriteand
  will
  Constructor code of children executed: 743
• Player renders changes display list: executed: 399
  Constructor code of children 685
  Avoid using TLF - when possible.
• UIComponent
• s:Label
  Use Halo components over Spark components.
  Constructor code of children executed: 1136
• Player renders changes display list: executed: 1078
  Constructor code of children 198 use Sprite
  When creating custom components
  over MovieClip and UIComponent over Group
• Group
• s:RichText
• Constructor codegraphics it’s recommended to use
  When creating of children executed: 416
  Player renders changes display list: executed: 1195
  Constructor code of children 3224
  Shape display object.
Tip #11: Avoid expensive
          operations


• Bitmap filters and perspective distortion
• Frequently-updated Text
Tip #12: Decreasing execution time
•   Primitives vs generic object
    if...else statements
•
•   Use strict mode
    Typing over generic objects
•
•   Flex related tips
    Loops
•   Use e4x with caution
•   Array vs ByteArray vs Vector
•   Increasing rendering speed
•
•   Callbacks andas BitmapData or Bitmap
    Manual cache events
•
•   Regex as bitmap matrix
    Cache and search string
•   Databinding
    Set all children caching policy
•
•   Check the status of all children
    Sealed vs. dynamic classes
Tip #13: Avoiding initializing and
  reference to unused classes
Tip #14: Set redraw region
          to min
Tip #15: Reducing swf
                file size
• Limit font unicode-range
• Implement RSL in your project - Runtime
  Shared Libraries
• Load assets on runtime and reduce assets file
  size
• Export Release Build
• Using strict mode
#16: Use Tools to reduce swf
          file size


• Apparat
• SWF Optimizer
Tip #17: Splitting apps into modules
Tip #18: Reuse objects - Object
           pooling
Tip #19: Working with
      external assets


• caching data in the memory
• cache data on the local device
• Image blitting
#20: be poactive & keep
               optimizing

• Be Proactive: take into account benchmark
  and memory usage when writing your code.
• Write code first: create your application and
  after it’s running, take time to optimize.
Q&A

• http://elromdesign.com/blog


• eladelrom-
  preso.googlecode.com/files/OptimizeFl
  ashContnet.pptx

• http://www.slideshare.net/eladnyc

                       @EladElrom
24

More Related Content

Similar to 20 x Tips to better Optimize your Flash content

Where is the bottleneck
Where is the bottleneckWhere is the bottleneck
Where is the bottleneck
Manuel Miranda de Cid
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
360|Conferences
 
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
NCCOMMS
 
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Lviv Startup Club
 
From Web to Mobile with Stage 3D
From Web to Mobile with Stage 3DFrom Web to Mobile with Stage 3D
From Web to Mobile with Stage 3D
Jean-Philippe Doiron
 
[Pinto] Is my SharePoint Development team properly enlighted?
[Pinto] Is my SharePoint Development team properly enlighted?[Pinto] Is my SharePoint Development team properly enlighted?
[Pinto] Is my SharePoint Development team properly enlighted?
European Collaboration Summit
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
Opersys inc.
 
Profiling tools and Android Performance patterns
Profiling tools and Android Performance patternsProfiling tools and Android Performance patterns
Profiling tools and Android Performance patterns
icemobile
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
Opersys inc.
 
From HTML to pixels on the Screen
From HTML to pixels on the ScreenFrom HTML to pixels on the Screen
From HTML to pixels on the Screen
Igor Talic
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node
ibmwebspheresoftware
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...
Peter Gfader
 
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
LogeekNightUkraine
 
Workflow Refactoring
Workflow RefactoringWorkflow Refactoring
Workflow Refactoring
Kevin Cao
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
AEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly toolsAEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly tools
Ashokkumar T A
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development Guide
Stanley Fok
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 

Similar to 20 x Tips to better Optimize your Flash content (20)

Where is the bottleneck
Where is the bottleneckWhere is the bottleneck
Where is the bottleneck
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
 
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
 
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
 
From Web to Mobile with Stage 3D
From Web to Mobile with Stage 3DFrom Web to Mobile with Stage 3D
From Web to Mobile with Stage 3D
 
[Pinto] Is my SharePoint Development team properly enlighted?
[Pinto] Is my SharePoint Development team properly enlighted?[Pinto] Is my SharePoint Development team properly enlighted?
[Pinto] Is my SharePoint Development team properly enlighted?
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 
Profiling tools and Android Performance patterns
Profiling tools and Android Performance patternsProfiling tools and Android Performance patterns
Profiling tools and Android Performance patterns
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
 
From HTML to pixels on the Screen
From HTML to pixels on the ScreenFrom HTML to pixels on the Screen
From HTML to pixels on the Screen
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...
 
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
 
Workflow Refactoring
Workflow RefactoringWorkflow Refactoring
Workflow Refactoring
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
AEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly toolsAEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly tools
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development Guide
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 

More from Elad Elrom

Developing & Deploying AIR Applications for TV
Developing & Deploying AIR Applications for TVDeveloping & Deploying AIR Applications for TV
Developing & Deploying AIR Applications for TV
Elad Elrom
 
Essential Eclipse Plug-ins and Tools for Flash Builder Developers
Essential Eclipse Plug-ins and Tools for Flash Builder DevelopersEssential Eclipse Plug-ins and Tools for Flash Builder Developers
Essential Eclipse Plug-ins and Tools for Flash Builder Developers
Elad Elrom
 
Top security threats to Flash/Flex applications and how to avoid them
Top security threats to Flash/Flex applications and how to avoid themTop security threats to Flash/Flex applications and how to avoid them
Top security threats to Flash/Flex applications and how to avoid them
Elad Elrom
 
Flex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakesFlex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakes
Elad Elrom
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Elad Elrom
 
Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5
Elad Elrom
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 Unconference
Elad Elrom
 

More from Elad Elrom (7)

Developing & Deploying AIR Applications for TV
Developing & Deploying AIR Applications for TVDeveloping & Deploying AIR Applications for TV
Developing & Deploying AIR Applications for TV
 
Essential Eclipse Plug-ins and Tools for Flash Builder Developers
Essential Eclipse Plug-ins and Tools for Flash Builder DevelopersEssential Eclipse Plug-ins and Tools for Flash Builder Developers
Essential Eclipse Plug-ins and Tools for Flash Builder Developers
 
Top security threats to Flash/Flex applications and how to avoid them
Top security threats to Flash/Flex applications and how to avoid themTop security threats to Flash/Flex applications and how to avoid them
Top security threats to Flash/Flex applications and how to avoid them
 
Flex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakesFlex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakes
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 Unconference
 

Recently uploaded

一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理
yuhofha
 
labb123456789123456789123456789123456789
labb123456789123456789123456789123456789labb123456789123456789123456789123456789
labb123456789123456789123456789123456789
Ghh
 
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
taqyea
 
一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理
一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理
一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理
pxyhy
 
在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样
在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样
在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样
2zjra9bn
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
AlessandroMartins454470
 
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
2zjra9bn
 
Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...
Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...
Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...
dsnow9802
 
0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf
Thomas GIRARD BDes
 
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
MuhammadWaqasBaloch1
 
Leadership Ambassador club Adventist module
Leadership Ambassador club Adventist moduleLeadership Ambassador club Adventist module
Leadership Ambassador club Adventist module
kakomaeric00
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
Bruce Bennett
 
thyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatialthyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatial
Aditya Raghav
 
Introducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptxIntroducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptx
FauzanHarits1
 
5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf
Alliance Jobs
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
yuhofha
 
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
yuhofha
 
一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理
一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理
一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理
pxyhy
 
Lbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdfLbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdf
ashiquepa3
 
A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024
Bruce Bennett
 

Recently uploaded (20)

一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理
 
labb123456789123456789123456789123456789
labb123456789123456789123456789123456789labb123456789123456789123456789123456789
labb123456789123456789123456789123456789
 
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
 
一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理
一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理
一比一原版(SFU毕业证)西蒙弗雷泽大学毕业证如何办理
 
在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样
在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样
在线制作加拿大萨省大学毕业证文凭证书实拍图原版一模一样
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
 
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
 
Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...
Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...
Jill Pizzola's Tenure as Senior Talent Acquisition Partner at THOMSON REUTERS...
 
0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf
 
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
 
Leadership Ambassador club Adventist module
Leadership Ambassador club Adventist moduleLeadership Ambassador club Adventist module
Leadership Ambassador club Adventist module
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
thyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatialthyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatial
 
Introducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptxIntroducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptx
 
5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
 
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
 
一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理
一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理
一比一原版(UBC毕业证)不列颠哥伦比亚大学毕业证如何办理
 
Lbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdfLbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdf
 
A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024
 

20 x Tips to better Optimize your Flash content

  • 1. 20 x Tips to better Optimize your Flash content @EladElrom
  • 2. #1: Flash Player 10.1 “out of the box” optimization • Instance Management • Screensaver Mode NativeApplication.nativeApplication.systemI dleMode = SystemIdleMode.KEEP_AWAKE; • GPU Hardware Acceleration allows bitmap blitting stops using software (CPU) rendering altogether
  • 3. #2: Profiling ur App • • Open Source Benchmark • Flash BuilderProfiler - Tools Rate Flash Benchmark 4.1 System FlexUnit 8: - Profiler Profiling withMonitor Frame • • FrameStats Benchmark AS3 Grant Skinner’s http://www.kongregate.com/games/SnailsAnimation/flash-benchmark-08 http://jpauclair.net/flashpreloadprofiler/ or http://www.timo-ernst.net/misc/riabench-start/
  • 4. #2: Profiling ur App • OHHH…. I almost forgot!!! • you can just do: getSize to find out the memory size of an object
  • 6. Tip #4: I/O •••StrongRTMP.the data with AMF on client and AMF, lazy loading James Ward’s tool to Use type Use whenever possible. server side to increase performance. benchmark and see the memory difference: http://www.jamesward.com/census/.
  • 7. Tip #5: Manipulating swf Framerate • Reducing fps when your app is inactive • Increase the fps once the app is active again https://github.com/EladElrom/Flash-Optimizing-Tools • Increase fps while animation is playing to framerateManager:FrameRateOptimizer = create a morenew FrameRateOptimizer(and keeping smooth experience this, true ); a stack of all the animations being played to know when we can drop the fps. • Provide a cross platform API (Pure AS3, Flex, AIR)
  • 8. Tip #6: Reduce memory usage Memory leaks due to listeners that have been set by us or someone else and never removed from memory: Solution: Listeners API movieClip.addEventListener( listeners.type = MouseEvent.CLICK, listeners.handler = onClick ); movieClip.addEventListener( listeners.type = MouseEvent.DOUBLE_CLICK, listeners.handler = onDoubleClick ); listeners.removeAllListeners( movieClip );
  • 9. Tip #7: Avoid memory leaks Call gc twice, or in AIR system.gc(): Ensure GC will do his job correctly: • Set weekly references - where possible: addEventListeners and Dictionary classes. • Don’t keep references - nulling objects with events don’t unhook them.
  • 10. Tip #8: Update screen once per frame Elastic Racetrack • Frame starts - Event.ENTER_FRAME • Frame actions executed - Event.FRAME_CONSTRUCTED • Avoid using updateAfterEvent, • End of Frame cycle - Event.EXIT_FRAME since it • Pre-render phasePlayer- and increases the player interrupt the starts Event.RENDER • Final user code is executed work load. • Player renders changes to display own using the • Handle invalidation on your • Cycle completed stage.invalidate() property
  • 11. Tip #9: Decrease nesting
  • 12. Tip #10: Reduce complexity • Shape level classes such as • TextField • Constructor code of children executed: 68 Use low Constructor code of children executed: 276 Player renders changes display list: possible) over TextField, SimpleButton (when 168 • mx:Text Spark. It will require more coding but • haloimprove performance. Spriteand will Constructor code of children executed: 743 • Player renders changes display list: executed: 399 Constructor code of children 685 Avoid using TLF - when possible. • UIComponent • s:Label Use Halo components over Spark components. Constructor code of children executed: 1136 • Player renders changes display list: executed: 1078 Constructor code of children 198 use Sprite When creating custom components over MovieClip and UIComponent over Group • Group • s:RichText • Constructor codegraphics it’s recommended to use When creating of children executed: 416 Player renders changes display list: executed: 1195 Constructor code of children 3224 Shape display object.
  • 13. Tip #11: Avoid expensive operations • Bitmap filters and perspective distortion • Frequently-updated Text
  • 14. Tip #12: Decreasing execution time • Primitives vs generic object if...else statements • • Use strict mode Typing over generic objects • • Flex related tips Loops • Use e4x with caution • Array vs ByteArray vs Vector • Increasing rendering speed • • Callbacks andas BitmapData or Bitmap Manual cache events • • Regex as bitmap matrix Cache and search string • Databinding Set all children caching policy • • Check the status of all children Sealed vs. dynamic classes
  • 15. Tip #13: Avoiding initializing and reference to unused classes
  • 16. Tip #14: Set redraw region to min
  • 17. Tip #15: Reducing swf file size • Limit font unicode-range • Implement RSL in your project - Runtime Shared Libraries • Load assets on runtime and reduce assets file size • Export Release Build • Using strict mode
  • 18. #16: Use Tools to reduce swf file size • Apparat • SWF Optimizer
  • 19. Tip #17: Splitting apps into modules
  • 20. Tip #18: Reuse objects - Object pooling
  • 21. Tip #19: Working with external assets • caching data in the memory • cache data on the local device • Image blitting
  • 22. #20: be poactive & keep optimizing • Be Proactive: take into account benchmark and memory usage when writing your code. • Write code first: create your application and after it’s running, take time to optimize.
  • 23. Q&A • http://elromdesign.com/blog • eladelrom- preso.googlecode.com/files/OptimizeFl ashContnet.pptx • http://www.slideshare.net/eladnyc @EladElrom
  • 24. 24