SlideShare una empresa de Scribd logo
1 de 24
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

Más contenido relacionado

Similar a 20 x Tips to better Optimize your Flash content

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 Example360|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 developmentITCamp
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Lviv Startup Club
 
[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 2014Opersys inc.
 
Profiling tools and Android Performance patterns
Profiling tools and Android Performance patternsProfiling tools and Android Performance patterns
Profiling tools and Android Performance patternsicemobile
 
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 2013Opersys 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 ScreenIgor Talic
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys 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 RefactoringKevin Cao
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys 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 toolsAshokkumar T A
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development GuideStanley Fok
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 

Similar a 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
 

Más de Elad Elrom

Developing & Deploying AIR Applications for TV
Developing & Deploying AIR Applications for TVDeveloping & Deploying AIR Applications for TV
Developing & Deploying AIR Applications for TVElad 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 DevelopersElad 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 themElad 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 mistakesElad 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 presoElad 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.5Elad Elrom
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceElad Elrom
 

Más de 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
 

Último

Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)sonalinghatmal
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jonesjonesyde302
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.GabrielaMiletti
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineBruce Bennett
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...Call Girls in Nagpur High Profile
 
➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men 🔝bhavnagar🔝 Esc...
➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men  🔝bhavnagar🔝   Esc...➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men  🔝bhavnagar🔝   Esc...
➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men 🔝bhavnagar🔝 Esc...amitlee9823
 
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...only4webmaster01
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkSujalTamhane
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...sonalitrivedi431
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...amitlee9823
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...amitlee9823
 
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night StandCall Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...poojakaurpk09
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...ZurliaSoop
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNBruce Bennett
 

Último (20)

Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jones
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
 
➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men 🔝bhavnagar🔝 Esc...
➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men  🔝bhavnagar🔝   Esc...➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men  🔝bhavnagar🔝   Esc...
➥🔝 7737669865 🔝▻ bhavnagar Call-girls in Women Seeking Men 🔝bhavnagar🔝 Esc...
 
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmk
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
 
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night StandCall Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
 
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWN
 

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