SlideShare une entreprise Scribd logo
1  sur  44
ACTIONSCRIPT 3:
COMMON OPTIMIZATION
         Teerasej Jiraphatchandej
  User Group Manager, Thai Adobe Developer Community




                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Understand:

CODE
EXECUTION
                                    Create by Teerasej Jiraphatchandej.
       All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



                                           24 fps




                               Create by Teerasej Jiraphatchandej.
  All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



•   Phase 1: event & enter frame

•   Phase 2: rendering




                                           Create by Teerasej Jiraphatchandej.
              All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



Phase 1                                    Phase 2




                                 Create by Teerasej Jiraphatchandej.
    All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



Phase 1                                    Phase 2




                                 Create by Teerasej Jiraphatchandej.
    All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



Phase 1                                    Phase 2




                                 Create by Teerasej Jiraphatchandej.
    All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



Phase 1                                                 Phase 2




                                 Create by Teerasej Jiraphatchandej.
    All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CODE EXECUTION



< 24 fps




                                  Create by Teerasej Jiraphatchandej.
     All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Guideline:

OPTIMIZATION
                                     Create by Teerasej Jiraphatchandej.
        All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Create by Teerasej Jiraphatchandej.


AVOID OPTIMIZATION EARLY
                                                           All rights reserved .
                                          Thai Adobe Developer Community .
                                            http://thaiadc.groups.adobe.com




          http://www.flickr.com/photos/23912215@N02/4112230589/
Create by Teerasej Jiraphatchandej.


SOME OPS, NOT NOTICEABLE
                                                     All rights reserved .
                                    Thai Adobe Developer Community .
                                      http://thaiadc.groups.adobe.com




            6264966_82f69fd170_b.jpg from flickr
Create by Teerasej Jiraphatchandej.


OPTIMIZED IS HARD MAINTAIN
                                                          All rights reserved .
                                         Thai Adobe Developer Community .
                                           http://thaiadc.groups.adobe.com




           http://www.flickr.com/photos/nigelmeng/636115602/
Create by Teerasej Jiraphatchandej.


DON’T USE FILTER
                                                           All rights reserved .
                                          Thai Adobe Developer Community .
                                            http://thaiadc.groups.adobe.com




          http://www.flickr.com/photos/kwerfeldein/1693519458/
Create by Teerasej Jiraphatchandej.


AVOID MOTION
                                                          All rights reserved .
                                         Thai Adobe Developer Community .
                                           http://thaiadc.groups.adobe.com




         http://www.flickr.com/photos/saxonmoseley/106432807/
Create by Teerasej Jiraphatchandej.


PERFORMANCE TEST
                                                     All rights reserved .
                                    Thai Adobe Developer Community .
                                      http://thaiadc.groups.adobe.com




           1717925528_1aba213644_o.jpg from flickr
Tips 1:

USE
BITMAP
                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
FLASH CS6 BITMAP


•   Normal

•   Cache as Bitmap

•   Export as Bitmap


                                           Create by Teerasej Jiraphatchandej.
              All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
CACHE AS BITMAP


•   Possible use more memory than vector.

•   Apply to each graphic, not animated movie clip.

•   Don’t use with container that has animating children


                                           Create by Teerasej Jiraphatchandej.
              All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
EXPORT AS BITMAP



•   Good for static object

•   Increase SWF file size.




                                            Create by Teerasej Jiraphatchandej.
               All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Tips 2:

CONSERVING
MEMORY
                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
DISPLAY OBJECT TYPE


•   Shape
•   Sprite
•   MovieClip

                                          Create by Teerasej Jiraphatchandej.
             All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
SHAPE




                             Create by Teerasej Jiraphatchandej.
All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
SPRITE




                             Create by Teerasej Jiraphatchandej.
All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
MOVIE CLIP




                             Create by Teerasej Jiraphatchandej.
All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
PRIMITIVE


•   Around 4 - 8 KB
•   String depend on used
•   Can’t optimize more

                                         Create by Teerasej Jiraphatchandej.
            All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Tips 3:

REUSING
OBJECT
                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
REUSING OBJECT


for ( ... ) {
  var a : Object = new ...
}




                                  Create by Teerasej Jiraphatchandej.
     All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
REUSING OBJECT

var a:Object;

for ( ... ) {
  a = new ...
}


                                  Create by Teerasej Jiraphatchandej.
     All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Tips 4:

FREE MEMORY
                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
GARBAGE COLLECTOR



                                Create by Teerasej Jiraphatchandej.
   All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
GARBAGE COLLECTOR
  Stage


           MovieClip
                                                  MovieClip


                                                  MovieClip
           MovieClip

                                                  MovieClip
                                 Create by Teerasej Jiraphatchandej.
    All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
GARBAGE COLLECTOR
       Stage


                MovieClip
GC                                                     MovieClip


                                                       MovieClip
                MovieClip

                                                       MovieClip
                                      Create by Teerasej Jiraphatchandej.
         All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
FORCE GC TO WORK


•   remove all reference to object

    •   Remove event listener

    •   Set object to null


                                              Create by Teerasej Jiraphatchandej.
                 All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
FORCE GC TO WORK


obj.removeEventListener();




                                   Create by Teerasej Jiraphatchandej.
      All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
BEWARE!!


•   Set object to null, not force GC to run immediately

•   GC use CPU and memory in running.

•   Adobe AIR force GC using: System.GC();


                                            Create by Teerasej Jiraphatchandej.
               All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Tips 5:

DEACTIVATE
                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
ACTIVATE AND DEACTIVATE


•   Object that removed from stage, doesn’t be destroyed
    immediately

•   Use framework to optimize performance



                                           Create by Teerasej Jiraphatchandej.
              All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
FORCE GC TO WORK


  Event.ADD_TO_STAGE
EVENT.REMOVE_FROM_STAGE




                                  Create by Teerasej Jiraphatchandej.
     All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
Tips 6:

DISABLE
MOUSE
                                       Create by Teerasej Jiraphatchandej.
          All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
DISABLE MOUSE



• obj.mouseEnable                = false;

• obj.mouseChildren                    = false;




                                     Create by Teerasej Jiraphatchandej.
        All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
GUIDELINE SUMMARY

•   Don’t optimize too early

•   Some optimization will not be noticeable by user

•   Don’t use filter

•   Avoid motion

•   Do performance test
                                             Create by Teerasej Jiraphatchandej.
                All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
TIPS SUMMARY

•   Use BitMap

•   Conserving memory

•   Reusing object

•   Free memory

•   Activate & Deactivate

•   Disable Mouse
                                              Create by Teerasej Jiraphatchandej.
                 All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
TEERASEJ
JIRAPHATCHANDEJ
USER GROUP MANAGER
THAI ADOBE DEVELOPER COMMUNITY

     teerasej@gmail.com

     teerasej

     thaiadc.com

Contenu connexe

Similaire à ActionScript 3 Optimization Tips

Ajax Development With Dreamweaver
Ajax Development With DreamweaverAjax Development With Dreamweaver
Ajax Development With DreamweaverAndreCharland
 
Adobe Max 2022 : Premiere Pro 
Beyond the Basics
Adobe Max 2022 : Premiere Pro 
Beyond the BasicsAdobe Max 2022 : Premiere Pro 
Beyond the Basics
Adobe Max 2022 : Premiere Pro 
Beyond the BasicsRichard Harrington
 
Getting Started Adobe Edge Code CC & Brackets
Getting Started Adobe Edge Code CC & BracketsGetting Started Adobe Edge Code CC & Brackets
Getting Started Adobe Edge Code CC & BracketsTeerasej Jiraphatchandej
 
Search Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black MagicSearch Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black Magicguestb1f3a
 
Android reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skypeAndroid reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skypeMário Almeida
 
Webinar on How to use MyAppConverter
Webinar on How to use  MyAppConverterWebinar on How to use  MyAppConverter
Webinar on How to use MyAppConverterJaoued Ahmed
 
Drupal Video Presentation
Drupal Video PresentationDrupal Video Presentation
Drupal Video PresentationEric Michalsen
 
iLife & iWork PowerBoost Presentation
iLife & iWork PowerBoost PresentationiLife & iWork PowerBoost Presentation
iLife & iWork PowerBoost PresentationTracy Zang
 
Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...
Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...
Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...TechSoup
 
Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14
Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14
Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14TechSoup
 
How to Make New Nonprofit Videos from Old Content Using Adobe Rush
How to Make New Nonprofit Videos from Old Content Using Adobe RushHow to Make New Nonprofit Videos from Old Content Using Adobe Rush
How to Make New Nonprofit Videos from Old Content Using Adobe RushTechSoup
 
Active Web Development
Active Web DevelopmentActive Web Development
Active Web DevelopmentDivya Manian
 
COSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFCOSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFPRADA Hsiung
 
Startup and Rapid web development
Startup and Rapid web developmentStartup and Rapid web development
Startup and Rapid web developmentLalit Shandilya
 
Tools for Agility
Tools for AgilityTools for Agility
Tools for AgilityCory Foy
 

Similaire à ActionScript 3 Optimization Tips (20)

Native VS HTML5
Native VS HTML5Native VS HTML5
Native VS HTML5
 
Ajax Development With Dreamweaver
Ajax Development With DreamweaverAjax Development With Dreamweaver
Ajax Development With Dreamweaver
 
Adobe Max 2022 : Premiere Pro 
Beyond the Basics
Adobe Max 2022 : Premiere Pro 
Beyond the BasicsAdobe Max 2022 : Premiere Pro 
Beyond the Basics
Adobe Max 2022 : Premiere Pro 
Beyond the Basics
 
Getting Started Adobe Edge Code CC & Brackets
Getting Started Adobe Edge Code CC & BracketsGetting Started Adobe Edge Code CC & Brackets
Getting Started Adobe Edge Code CC & Brackets
 
Search Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black MagicSearch Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black Magic
 
Android reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skypeAndroid reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skype
 
Setup and run wordpress: 201
Setup and run wordpress: 201Setup and run wordpress: 201
Setup and run wordpress: 201
 
Webinar on How to use MyAppConverter
Webinar on How to use  MyAppConverterWebinar on How to use  MyAppConverter
Webinar on How to use MyAppConverter
 
Php2pdf
Php2pdfPhp2pdf
Php2pdf
 
Drupal Video Presentation
Drupal Video PresentationDrupal Video Presentation
Drupal Video Presentation
 
iLife & iWork PowerBoost Presentation
iLife & iWork PowerBoost PresentationiLife & iWork PowerBoost Presentation
iLife & iWork PowerBoost Presentation
 
Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...
Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...
Webinar - Storymakers 3: Polishing Your Digital Story to Make It Shine! 2016-...
 
Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14
Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14
Webinar - Video Editing and Production with Adobe Premiere Pro - 2016-06-14
 
FVCP Ad Words
FVCP Ad WordsFVCP Ad Words
FVCP Ad Words
 
How to Make New Nonprofit Videos from Old Content Using Adobe Rush
How to Make New Nonprofit Videos from Old Content Using Adobe RushHow to Make New Nonprofit Videos from Old Content Using Adobe Rush
How to Make New Nonprofit Videos from Old Content Using Adobe Rush
 
Active Web Development
Active Web DevelopmentActive Web Development
Active Web Development
 
COSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFCOSCUP 2017 FACE OFF
COSCUP 2017 FACE OFF
 
Startup and Rapid web development
Startup and Rapid web developmentStartup and Rapid web development
Startup and Rapid web development
 
Viditor at WTF2013
Viditor at WTF2013Viditor at WTF2013
Viditor at WTF2013
 
Tools for Agility
Tools for AgilityTools for Agility
Tools for Agility
 

Plus de Teerasej Jiraphatchandej

Microsoft Power Page for Developer - ภาษาไทย
Microsoft Power Page for Developer - ภาษาไทยMicrosoft Power Page for Developer - ภาษาไทย
Microsoft Power Page for Developer - ภาษาไทยTeerasej Jiraphatchandej
 
Azure DevOps with Power Automate - Guideline
Azure DevOps with Power Automate - GuidelineAzure DevOps with Power Automate - Guideline
Azure DevOps with Power Automate - GuidelineTeerasej Jiraphatchandej
 
Getting Started Azure Cognitive Service Container
Getting Started Azure Cognitive Service ContainerGetting Started Azure Cognitive Service Container
Getting Started Azure Cognitive Service ContainerTeerasej Jiraphatchandej
 
Software developer: Prepare for the real world
Software developer: Prepare for the real worldSoftware developer: Prepare for the real world
Software developer: Prepare for the real worldTeerasej Jiraphatchandej
 
.NET Bangkok Meetup #42 - Extract information from your document with Azure F...
.NET Bangkok Meetup #42 - Extract information from your document with Azure F....NET Bangkok Meetup #42 - Extract information from your document with Azure F...
.NET Bangkok Meetup #42 - Extract information from your document with Azure F...Teerasej Jiraphatchandej
 
.NET Conference 2020 - Introduction to Azure Form Recognizer
.NET Conference 2020 - Introduction to Azure Form Recognizer.NET Conference 2020 - Introduction to Azure Form Recognizer
.NET Conference 2020 - Introduction to Azure Form RecognizerTeerasej Jiraphatchandej
 
What da Frontend? - How to start learning Front-end technology without pain.
What da Frontend? - How to start learning Front-end technology without pain.What da Frontend? - How to start learning Front-end technology without pain.
What da Frontend? - How to start learning Front-end technology without pain.Teerasej Jiraphatchandej
 
Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...
Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...
Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...Teerasej Jiraphatchandej
 
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้นเรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้นTeerasej Jiraphatchandej
 
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ Teerasej Jiraphatchandej
 
สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]
สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]
สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]Teerasej Jiraphatchandej
 
PhoneGap/Cordova: Push notification on Android
PhoneGap/Cordova: Push notification on AndroidPhoneGap/Cordova: Push notification on Android
PhoneGap/Cordova: Push notification on AndroidTeerasej Jiraphatchandej
 
เร่ิมต้นสร้าง Facebook page สำหรับ line creator
เร่ิมต้นสร้าง Facebook page สำหรับ line creatorเร่ิมต้นสร้าง Facebook page สำหรับ line creator
เร่ิมต้นสร้าง Facebook page สำหรับ line creatorTeerasej Jiraphatchandej
 
เริ่มต้นสร้างแอพ Android Wear โดยโค้ชพล
เริ่มต้นสร้างแอพ Android Wear โดยโค้ชพลเริ่มต้นสร้างแอพ Android Wear โดยโค้ชพล
เริ่มต้นสร้างแอพ Android Wear โดยโค้ชพลTeerasej Jiraphatchandej
 
LINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE Sticker
LINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE StickerLINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE Sticker
LINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE StickerTeerasej Jiraphatchandej
 

Plus de Teerasej Jiraphatchandej (20)

Microsoft Power Page for Developer - ภาษาไทย
Microsoft Power Page for Developer - ภาษาไทยMicrosoft Power Page for Developer - ภาษาไทย
Microsoft Power Page for Developer - ภาษาไทย
 
Azure DevOps with Power Automate - Guideline
Azure DevOps with Power Automate - GuidelineAzure DevOps with Power Automate - Guideline
Azure DevOps with Power Automate - Guideline
 
Getting Started Azure Cognitive Service Container
Getting Started Azure Cognitive Service ContainerGetting Started Azure Cognitive Service Container
Getting Started Azure Cognitive Service Container
 
Power App - Wrap Sneak peek
Power App - Wrap Sneak peekPower App - Wrap Sneak peek
Power App - Wrap Sneak peek
 
Software developer: Prepare for the real world
Software developer: Prepare for the real worldSoftware developer: Prepare for the real world
Software developer: Prepare for the real world
 
.NET Bangkok Meetup #42 - Extract information from your document with Azure F...
.NET Bangkok Meetup #42 - Extract information from your document with Azure F....NET Bangkok Meetup #42 - Extract information from your document with Azure F...
.NET Bangkok Meetup #42 - Extract information from your document with Azure F...
 
.NET Conference 2020 - Introduction to Azure Form Recognizer
.NET Conference 2020 - Introduction to Azure Form Recognizer.NET Conference 2020 - Introduction to Azure Form Recognizer
.NET Conference 2020 - Introduction to Azure Form Recognizer
 
Introduction to Webometrics
Introduction to WebometricsIntroduction to Webometrics
Introduction to Webometrics
 
OK Flutter, Welcome to All platform era
OK Flutter, Welcome to All platform eraOK Flutter, Welcome to All platform era
OK Flutter, Welcome to All platform era
 
What da Frontend? - How to start learning Front-end technology without pain.
What da Frontend? - How to start learning Front-end technology without pain.What da Frontend? - How to start learning Front-end technology without pain.
What da Frontend? - How to start learning Front-end technology without pain.
 
Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...
Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...
Front-end อะไรเนี้ย? - เริ่มต้นเรียนรู้ และเข้าใจโลกของ Front-end Development...
 
React native - What, Why, How?
React native - What, Why, How?React native - What, Why, How?
React native - What, Why, How?
 
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้นเรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
 
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
Angular JS: First look เริ่มต้น Angular JS กันแบบสบายๆ
 
สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]
สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]
สร้าง Facebook Fan Page อย่างไร ให้ยั่งยืน [บรรยายในงาน LINE Creator Meeting 3]
 
Ionic framework for web developer
Ionic framework for web developerIonic framework for web developer
Ionic framework for web developer
 
PhoneGap/Cordova: Push notification on Android
PhoneGap/Cordova: Push notification on AndroidPhoneGap/Cordova: Push notification on Android
PhoneGap/Cordova: Push notification on Android
 
เร่ิมต้นสร้าง Facebook page สำหรับ line creator
เร่ิมต้นสร้าง Facebook page สำหรับ line creatorเร่ิมต้นสร้าง Facebook page สำหรับ line creator
เร่ิมต้นสร้าง Facebook page สำหรับ line creator
 
เริ่มต้นสร้างแอพ Android Wear โดยโค้ชพล
เริ่มต้นสร้างแอพ Android Wear โดยโค้ชพลเริ่มต้นสร้างแอพ Android Wear โดยโค้ชพล
เริ่มต้นสร้างแอพ Android Wear โดยโค้ชพล
 
LINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE Sticker
LINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE StickerLINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE Sticker
LINE Creator Meeting Thailand #1: เริ่มต้นเรียนรู้การสร้าง LINE Sticker
 

Dernier

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

ActionScript 3 Optimization Tips

  • 1. ACTIONSCRIPT 3: COMMON OPTIMIZATION Teerasej Jiraphatchandej User Group Manager, Thai Adobe Developer Community Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 2. Understand: CODE EXECUTION Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 3. CODE EXECUTION 24 fps Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 4. CODE EXECUTION • Phase 1: event & enter frame • Phase 2: rendering Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 5. CODE EXECUTION Phase 1 Phase 2 Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 6. CODE EXECUTION Phase 1 Phase 2 Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 7. CODE EXECUTION Phase 1 Phase 2 Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 8. CODE EXECUTION Phase 1 Phase 2 Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 9. CODE EXECUTION < 24 fps Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 10. Guideline: OPTIMIZATION Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 11. Create by Teerasej Jiraphatchandej. AVOID OPTIMIZATION EARLY All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com http://www.flickr.com/photos/23912215@N02/4112230589/
  • 12. Create by Teerasej Jiraphatchandej. SOME OPS, NOT NOTICEABLE All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com 6264966_82f69fd170_b.jpg from flickr
  • 13. Create by Teerasej Jiraphatchandej. OPTIMIZED IS HARD MAINTAIN All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com http://www.flickr.com/photos/nigelmeng/636115602/
  • 14. Create by Teerasej Jiraphatchandej. DON’T USE FILTER All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com http://www.flickr.com/photos/kwerfeldein/1693519458/
  • 15. Create by Teerasej Jiraphatchandej. AVOID MOTION All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com http://www.flickr.com/photos/saxonmoseley/106432807/
  • 16. Create by Teerasej Jiraphatchandej. PERFORMANCE TEST All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com 1717925528_1aba213644_o.jpg from flickr
  • 17. Tips 1: USE BITMAP Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 18. FLASH CS6 BITMAP • Normal • Cache as Bitmap • Export as Bitmap Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 19. CACHE AS BITMAP • Possible use more memory than vector. • Apply to each graphic, not animated movie clip. • Don’t use with container that has animating children Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 20. EXPORT AS BITMAP • Good for static object • Increase SWF file size. Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 21. Tips 2: CONSERVING MEMORY Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 22. DISPLAY OBJECT TYPE • Shape • Sprite • MovieClip Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 23. SHAPE Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 24. SPRITE Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 25. MOVIE CLIP Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 26. PRIMITIVE • Around 4 - 8 KB • String depend on used • Can’t optimize more Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 27. Tips 3: REUSING OBJECT Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 28. REUSING OBJECT for ( ... ) { var a : Object = new ... } Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 29. REUSING OBJECT var a:Object; for ( ... ) { a = new ... } Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 30. Tips 4: FREE MEMORY Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 31. GARBAGE COLLECTOR Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 32. GARBAGE COLLECTOR Stage MovieClip MovieClip MovieClip MovieClip MovieClip Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 33. GARBAGE COLLECTOR Stage MovieClip GC MovieClip MovieClip MovieClip MovieClip Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 34. FORCE GC TO WORK • remove all reference to object • Remove event listener • Set object to null Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 35. FORCE GC TO WORK obj.removeEventListener(); Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 36. BEWARE!! • Set object to null, not force GC to run immediately • GC use CPU and memory in running. • Adobe AIR force GC using: System.GC(); Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 37. Tips 5: DEACTIVATE Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 38. ACTIVATE AND DEACTIVATE • Object that removed from stage, doesn’t be destroyed immediately • Use framework to optimize performance Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 39. FORCE GC TO WORK Event.ADD_TO_STAGE EVENT.REMOVE_FROM_STAGE Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 40. Tips 6: DISABLE MOUSE Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 41. DISABLE MOUSE • obj.mouseEnable = false; • obj.mouseChildren = false; Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 42. GUIDELINE SUMMARY • Don’t optimize too early • Some optimization will not be noticeable by user • Don’t use filter • Avoid motion • Do performance test Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 43. TIPS SUMMARY • Use BitMap • Conserving memory • Reusing object • Free memory • Activate & Deactivate • Disable Mouse Create by Teerasej Jiraphatchandej. All rights reserved . Thai Adobe Developer Community . http://thaiadc.groups.adobe.com
  • 44. TEERASEJ JIRAPHATCHANDEJ USER GROUP MANAGER THAI ADOBE DEVELOPER COMMUNITY teerasej@gmail.com teerasej thaiadc.com