SlideShare a Scribd company logo
Extreme Mobile App Performance:

                         Native to Web
                                  Jacky Nguyen
                            Chief Mobile Architect - Sencha Inc.




          jacky@sencha.com                                         @nktpro

Wednesday, April 3, 13
vs.




Wednesday, April 3, 13
“Our biggest mistake was
         betting too much on HTML5”
                         Mark Zuckerberg - TechCrunch Disrupt 2012




Wednesday, April 3, 13
Fear


                                Doubt



                                        Bashing


Wednesday, April 3, 13
Talk               Talk          Talk

                            Talk
             Talk                         Talk

                         Talk
                                   Talk

            Talk
                           Talk

            Talk




Wednesday, April 3, 13
Talk               Talk          Talk

                            Talk
             Talk                         Talk

                         Talk
                                   Talk

            Talk
                           Talk
                                                        DO!
            Talk




Wednesday, April 3, 13
The challenging parts




Wednesday, April 3, 13
The challenging parts
           Constraints
        •Lots of data
        •Variety of content
        •Unknown item sizes




Wednesday, April 3, 13
The challenging parts
           Constraints
        •Lots of data
        •Variety of content
        •Unknown item sizes

                                        Requirements
                                        •60fps scrolling
                                        •Fast data loading
                                        •Fast rendering
Wednesday, April 3, 13
Under the hood




Wednesday, April 3, 13
Under the hood


                                  UIWebView




                                  UIWebView


Wednesday, April 3, 13
The problems




  “So while utilizing web technology [...], people expect a fast,
    reliable experience and our iOS app was falling short.”

Wednesday, April 3, 13
1


                         2


                         3




Wednesday, April 3, 13
1


                         2


                         3



                         4




Wednesday, April 3, 13
2


                         3



                         4



                         5




Wednesday, April 3, 13
2


                                 3



                                 4



                                 5




                         Web page approach
Wednesday, April 3, 13
Page vs app model
                                   Web page        Web app

                Payload          Huge, raw HTML   Minimal data

                State               Stateless       Stateful

                Memory              Increasing     Constant

                Performance        Degrading       Constant

                Prioritization         No             Yes



Wednesday, April 3, 13
Shut up and code!




Wednesday, April 3, 13
Shut up and code!

                   •Pure web (HTML + CSS + JavaScript)
                   •Cross-platform
                   •Using Facebook’s own APIs
                   •Build on top of Sencha Touch 2
                   •1 engineer, 1 manager, 3 weeks




Wednesday, April 3, 13
Shut up and code!




Wednesday, April 3, 13
Shut up and code!




Wednesday, April 3, 13
Infinite List techniques




Wednesday, April 3, 13
Infinite List techniques

                   •Recycling
                   •Prioritizing
                   •Sandboxing


Wednesday, April 3, 13
DOM recycling




Wednesday, April 3, 13
Infinite list - unknown item sizes

                         1


                         2


                         3


                         4

Wednesday, April 3, 13
Infinite list - unknown item sizes
                       1


                         2


                         3


                         4




Wednesday, April 3, 13
Infinite list - unknown item sizes

                         2


                         3


                         4



                         1


Wednesday, April 3, 13
Infinite list - unknown item sizes

                         2


                         3


                         4



                         5


Wednesday, April 3, 13
Infinite list - unknown item sizes

                         2


                         3


                         4



                         5         x

Wednesday, April 3, 13
Animation 101



                         A                   B




Wednesday, April 3, 13
CSS Positioning




Wednesday, April 3, 13
CSS Positioning




Wednesday, April 3, 13
Scroll Positioning




Wednesday, April 3, 13
Scroll Positioning




Wednesday, April 3, 13
Compositing




Wednesday, April 3, 13
Compositing




Wednesday, April 3, 13
Compositing for Infinite List




Wednesday, April 3, 13
Compositing for Infinite List
     •Composite each item and the container independently
     •Translate the container for every frame
     •Translate each item once per re-rendering cycle




Wednesday, April 3, 13
Compositing




Wednesday, April 3, 13
Compositing




Wednesday, April 3, 13
Compositing


                              1


                              2


                              3


                              4

Wednesday, April 3, 13
1


                         2


                         3


                         4




Wednesday, April 3, 13
2


                         3


                         4



                         1
                         5


Wednesday, April 3, 13
Batch DOM read / write separately


                         1

                         2
                         3

                         4

                         5


Wednesday, April 3, 13
1

                         2
                         3

                         4
                             translate inner   composite

                         5




Wednesday, April 3, 13
1

                         3                     2

                         4
                             translate inner       composite

                         5




Wednesday, April 3, 13
6

                                               7
                         3

                         4
                             translate inner       composite

                         5   render 6, 7           write




Wednesday, April 3, 13
6

                                               7
                         3

                         4
                             translate inner       composite

                         5   render 6, 7           write
                             read 6, 7 heights     read - layout




Wednesday, April 3, 13
3

                         4
                             translate inner     composite

                         5   render 6, 7         write
                             read 6, 7 heights   read - layout
                         6
                             translate 6, 7      composite
                         7


Wednesday, April 3, 13
Wednesday, April 3, 13
Prioritizing




Wednesday, April 3, 13
16.7ms

Wednesday, April 3, 13
Style recalculation
                           Layout
                           Compositing

                  16.7ms   Painting
                           Network requests
                           Image decoding
                           Data processing



Wednesday, April 3, 13
Style recalculation
                         Layout
                         Compositing

               100ms     Painting
                         Network requests
                         Image decoding
                         Data processing



Wednesday, April 3, 13
16ms
                         12ms
                         13ms   Style recalculation
                         60ms
                         15ms   Layout
                         13ms   Compositing
                         16ms
                         40ms   Painting
                         16ms   Network requests
                         17ms
                         15ms   Image decoding
                         55ms   Data processing
                         14ms
                         17ms
                         35ms
Wednesday, April 3, 13
The AnimationQueue


                            60fps




Wednesday, April 3, 13
The AnimationQueue
             Animation
                                          Touch events
                             60fps




         Image loading
                                              Data loading



           Image rendering

Wednesday, April 3, 13
Buffered rendering
                     Progressive             Buffered




Wednesday, April 3, 13
Buffered rendering
                     Progressive             Buffered




Wednesday, April 3, 13
Delayed image rendering




Wednesday, April 3, 13
Combined techniques




Wednesday, April 3, 13
Demo




Wednesday, April 3, 13
Scalability problem




                         60fps


Wednesday, April 3, 13
Scalability problem




                         60fps


Wednesday, April 3, 13
Scalability problem




                         50fps          50fps


Wednesday, April 3, 13
Scalability problem




                         40fps          40fps          40fps


Wednesday, April 3, 13
Scalability problem




                           8ms layout cost
Wednesday, April 3, 13
Scalability problem




                          40ms layout cost
Wednesday, April 3, 13
By making it fast, I make it slow...

Wednesday, April 3, 13
Sandboxing




Wednesday, April 3, 13
Sandboxing




Wednesday, April 3, 13
Sandboxing




Wednesday, April 3, 13
Sandboxing




Wednesday, April 3, 13
document




                   IFRAME        IFRAME     IFRAME

                         60fps    60fps      60fps
Wednesday, April 3, 13
Demo




Wednesday, April 3, 13
Extreme benefits, frameworks required

        •Bridge all events, remap coordinates
        •Copy stylesheets dynamically
        •Connect layouts
        •Workaround browser bugs




Wednesday, April 3, 13
Extreme benefits, frameworks required

        •Bridge all events, remap coordinates
        •Copy stylesheets dynamically
        •Connect layouts
        •Workaround browser bugs



                         That’s what frameworks are for!

Wednesday, April 3, 13
Stop reinventing the wheel




           https://www.sencha.com/store/sencha-touch-bundle
Wednesday, April 3, 13
Sum it up




Wednesday, April 3, 13
Wednesday, April 3, 13

More Related Content

Similar to Extreme Mobile App Performance: Native to Web

Intellectual property basics
Intellectual property basicsIntellectual property basics
Intellectual property basics
Krista Kennedy
 
Identity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DC
Identity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DCIdentity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DC
Identity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DC
Crossref
 
unplug c^r
unplug c^runplug c^r
unplug c^r
Jordan Presnick
 
Blog wars 2
Blog wars 2Blog wars 2
Redesigning UBC Library
Redesigning UBC LibraryRedesigning UBC Library
Redesigning UBC Library
jtcchan
 
RSC Future of Technology in Education
RSC Future of Technology in EducationRSC Future of Technology in Education
RSC Future of Technology in Education
Miles Metcalfe
 
CSS3 and jQuery for Designers
CSS3 and jQuery for DesignersCSS3 and jQuery for Designers
CSS3 and jQuery for Designers
lomalogue
 
Email by the Numbers
Email by the NumbersEmail by the Numbers
Email by the Numbers
Emma
 
Theres a rabbit on my symfony
Theres a rabbit on my symfonyTheres a rabbit on my symfony
Theres a rabbit on my symfony
Alvaro Videla
 

Similar to Extreme Mobile App Performance: Native to Web (9)

Intellectual property basics
Intellectual property basicsIntellectual property basics
Intellectual property basics
 
Identity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DC
Identity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DCIdentity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DC
Identity and the Scholar, 2009 Allen Press Seminar, April 2009, Washington DC
 
unplug c^r
unplug c^runplug c^r
unplug c^r
 
Blog wars 2
Blog wars 2Blog wars 2
Blog wars 2
 
Redesigning UBC Library
Redesigning UBC LibraryRedesigning UBC Library
Redesigning UBC Library
 
RSC Future of Technology in Education
RSC Future of Technology in EducationRSC Future of Technology in Education
RSC Future of Technology in Education
 
CSS3 and jQuery for Designers
CSS3 and jQuery for DesignersCSS3 and jQuery for Designers
CSS3 and jQuery for Designers
 
Email by the Numbers
Email by the NumbersEmail by the Numbers
Email by the Numbers
 
Theres a rabbit on my symfony
Theres a rabbit on my symfonyTheres a rabbit on my symfony
Theres a rabbit on my symfony
 

Recently uploaded

Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Vadym Kazulkin
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 

Recently uploaded (20)

Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
 

Extreme Mobile App Performance: Native to Web