SlideShare a Scribd company logo
1 of 68
Download to read offline
Understanding Mobile Web
    Browser Performance
    Rajiv Vijayakumar
    Qualcomm Incorporated




                               QUALCOMM CONFIDENTIAL AND PROPRIETARY
1
Topics

    § Mobile browser architecture
    § Mobile network latencies
    § Android HTTP: Parallel downloads and caching
    § Power consumption




2
SmartPhone Web Browsers




                              
3
What is a “WebKit” Browser?




                                  
4
Browser Architecture




5
Browser Architecture




             Layout Engine




5
Browser Architecture




                WebKit




5
Browser Architecture




                           JavaScript
                WebKit
                             Engine




5
Browser Architecture




                           JavaScriptCore
                WebKit
                               or V8




5
Browser Architecture




                           JavaScriptCore
                WebKit
                               or V8


               Rendering    Networking


5
Browser Architecture

                           Browser UI


                                   JavaScriptCore
                WebKit
                                       or V8


               Rendering                Networking


5
Android




              
6
Android Browser ≠ Chrome




                               
7
<img src="http://www.qualcomm.com/imgA.jpg">




8
<img src="http://www.qualcomm.com/imgA.jpg">




                                           Time




8
<img src="http://www.qualcomm.com/imgA.jpg">


        DNS

                                           Time




8
<img src="http://www.qualcomm.com/imgA.jpg">


                       DNS

                                           Time
                             96.16.97.9
    www.qualcomm.com




8
<img src="http://www.qualcomm.com/imgA.jpg">


        DNS      TCP

                                           Time




8
<img src="http://www.qualcomm.com/imgA.jpg">


        DNS         TCP

                                           Time
              SYN




                          SYN/ACK




8
<img src="http://www.qualcomm.com/imgA.jpg">


        DNS      TCP           HTTP

                                           Time




8
<img src="http://www.qualcomm.com/imgA.jpg">


        DNS      TCP                   HTTP

                                                          Time




                                        HTTP/1.1 200 OK
                       GET /imgA.jpg



8
<img src="http://www.qualcomm.com/imgA.jpg">


        DNS      TCP                   HTTP

                                                          Time




                                        HTTP/1.1 200 OK
                       GET /imgA.jpg



8
Latencies in 3G/4G Networks




9
Latencies in 3G/4G Networks

    § Initial connection setup: > 1s (on older 3G)




9
Latencies in 3G/4G Networks

    § Initial connection setup: > 1s (on older 3G)
    § Round trip time (RTT): 80ms or higher (typically)
     § 100 - 200ms common




9
RTTs at speed of light

     § San Diego – New York : ~26ms

     § San Diego – Johannesburg : ~110ms




10
Every round trip is at least 80-100ms


           DNS       TCP            HTTP




11
Every round trip is at least 80-100ms


           DNS        TCP               HTTP



              Including HTTP retrievals from a CDN




11
DNS
                           Every new lookup takes 1 RTT + Lookup Time
                                                                               Histogram of DNS Lookup Times

                                         150


                                         100


                                            50


                                              0
                                                  0              0.2              0.4   0.6     0.8    1.0     1.2   1.4
                                                                                         Seconds


12   Source: Data collected over 30 sites (280 domains) on Qualcomm corporate network
Domain Sharding

     § Use of multiple domains
        (cdn1.domain.com, cdn2.domain.com)

     § Requests may not happen in parallel...




13
Parallel Downloads

                   8 images across 2 domains

     cdn1.domain.com/img1A.png   cdn2.domain.com/img2A.png
     cdn1.domain.com/img1B.png   cdn2.domain.com/img2B.png
     cdn1.domain.com/img1C.png   cdn2.domain.com/img2C.png
     cdn1.domain.com/img1D.png   cdn2.domain.com/img2D.png




14
Browsers typically use 4-6 sockets per host

        img1A
        img1B
        img1C
                                             cdn1
        img1D



        img2A
        img2B
        img2C
                                             cdn2
        img2D



15
                t=0
Android

        img1A   img1D
        img1B
        img1C
                                        cdn1



        img2A   img2B
                        img2C
                                img2D   cdn2



16
Android

        img1A   img1D
        img1B
        img1C
                                        cdn1



        img2A   img2B
                        img2C
                                img2D   cdn2



16
Android

        img1A
        img1B
        img1C
                cdn1



        img2A

                cdn2



17
Android

        img1A          § “Thread per socket” model
        img1B
                cdn1
        img1C          § 4 HTTP threads


        img2A

                cdn2



17
QUALCOMM CONFIDENTIAL AND PROPRIETARY
18   Source: DDMS (from Android SDK) connected to Android 2.3.3 emulator
Android

        img1A          § “Thread per socket” model
        img1B
                cdn1
        img1C          § 4 HTTP threads


        img2A

                cdn2



19
Android

        img1A          § “Thread per socket” model
        img1B
                cdn1
        img1C          § 4 HTTP threads

                    § Only 4 sockets can have
        img2A
                       outstanding HTTP requests
                cdn2 (“active”)



19
Android

        img1A   img1D
        img1B
        img1C
                                        cdn1



        img2A   img2B
                        img2C
                                img2D   cdn2



20
Android

        img2A   img2B
                        img2C
                                img2D   cdn2




20
Android

        img2A          img2B
                               img2C
                                       img2D   cdn2
                Pipelining




20
Android

        img2A                               img2B
                                                    img2C
                                                            img2D   cdn2
                                   Pipelining

       § Send multiple requests without waiting for each
          response
        § Responses must arrive in order



20
Android

        img2A                               img2B
                                                    img2C
                                                            img2D   cdn2
                                   Pipelining

       § Send multiple requests without waiting for each
          response
        § Responses must arrive in order
       § Android pipelines up to 3 requests on each socket

20
Pipelining

     § Not supported, or not enabled by default on most major
        browsers

     § Historically caused problems (e.g. due to badly behaving
        proxies)

     § Millions of Android devices actively using pipelining
      § Time to revisit... ?


21
HTTP Caching




22
HTTP Caching

     § WebKit maintains a memory cache
      § Default size = 8 MB

     § Android has a persistent (file system) HTTP cache
      § Default size = 6 MB




22
Cache Eviction




23
Cache Eviction

     § What gets evicted to make room?




23
Cache Eviction

     § What gets evicted to make room?

     § Android policy: Prioritize base on expiration date
      § Far future expiration dates have higher priority
      § Evict lowest priority items first


                         Expires:Wed, 09 Jun 2021 21:12:36 GMT



23
Example of Cache Contents
     Visited several sites, read blog posts and linked articles etc.




24
Example of Cache Contents
     Visited several sites, read blog posts and linked articles etc.
      sqlite3 webviewCache.db 'select expires from cache order by expires desc;'




24
Example of Cache Contents
     Visited several sites, read blog posts and linked articles etc.
      sqlite3 webviewCache.db 'select expires from cache order by expires desc;'




                Expiration Year

                     2036

                     2035

                      ...

                     2011

24
Example of Cache Contents
     Visited several sites, read blog posts and linked articles etc.
      sqlite3 webviewCache.db 'select expires from cache order by expires desc;'



                                          200
                Expiration Year
                                          150
                     2036

                                  Count
                     2035                 100


                      ...                  50

                     2011
                                            0
                                                2010   2020          2030   2040
24                                                     Expiration Year
§ Cache eviction policy affects performance

     § Consider real-world cache occupancy when measuring
        cached page load performance




25
Caveats

     § Devices can (and do!) differ from stock Android

     § Differences in:
      § Number of HTTP threads
      § Cache size and eviction algorithm
      § etc.




26
Power
     What is the power drawn from the battery while loading a
     web page?




27
Battery Current (mA)




28   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
11s download (400mA)



                             Baseline (200 mA)                                                        10s idle (300mA)


                                                                                                                   QUALCOMM CONFIDENTIAL AND PROPRIETARY
29   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
Power
     § Any network traffic brings up the radio for several seconds
        § Network dormancy timer: typically 10-15 seconds
     § Use long periods for any periodic Ajax calls etc.




30   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
TCP FINs and Power




31   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
TCP FINs and Power
     § Android closes TCP sockets after ~6s of inactivity
        § Sockets get closed at different times




31   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
TCP FINs and Power
     § Android closes TCP sockets after ~6s of inactivity
        § Sockets get closed at different times
     § Every socket close generates a TCP FIN
        § Extends the dormancy timer
        § Keeps the modem on for a 1-bit communication




31   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
TCP FINs and Power
     § Android closes TCP sockets after ~6s of inactivity
        § Sockets get closed at different times
     § Every socket close generates a TCP FIN
        § Extends the dormancy timer
        § Keeps the modem on for a 1-bit communication
     § Optimization: close all sockets after page load completes




31   Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
JavaScript Performance

     § SunSpider benchmark numbers have improved dramatically
        in recent years
        § Android (Jun 2011) < 2.5s
        § Desktop Chrome (Sep 2008) ~2.8 s




32   Source: http://ejohn.org/blog/javascript-performance-rundown/
developer.qualcomm.com/webtech




33
Q&A




34
Disclaimer
                                                  QUALCOMM Incorporated
                                                   5775 Morehouse Drive
                                                 San Diego, CA. 92121-1714
                                                          U.S.A.
                                         Copyright © 2011 Qualcomm Incorporated.
                                                     All rights reserved.


          Not to be used, copied, reproduced in whole or in part, nor its contents revealed in any manner to others
          without the express written permission of Qualcomm.

          Qualcomm and MSM8655 are trademarks of Qualcomm Incorporated, registered in the United States.

          Other product and brand names may be trademarks or registered trademarks of their respective owners.

          Nothing in these materials is an offer to sell any of the components or devices referenced herein. Certain
          components for use in the U.S. are available only through licensed suppliers. Some components are not
          available for use in the U.S.




35

More Related Content

Similar to Understanding Mobile Web Performance

Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKitAriya Hidayat
 
Android Chromium Rendering Pipeline
Android Chromium Rendering PipelineAndroid Chromium Rendering Pipeline
Android Chromium Rendering PipelineHyungwook Lee
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
COSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge BoxCOSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge BoxShihta Kuan
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Deep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm ModeDeep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm ModeAjeet Singh Raina
 
DevOpsDays Taipei 2017 從打鐵到雲端
DevOpsDays Taipei 2017 從打鐵到雲端DevOpsDays Taipei 2017 從打鐵到雲端
DevOpsDays Taipei 2017 從打鐵到雲端Hung-Yen Chen
 
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
KubeCon EU 2016: Using Traffic Control to Test Apps in KubernetesKubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
KubeCon EU 2016: Using Traffic Control to Test Apps in KubernetesKubeAcademy
 
Implementing distributed mclock in ceph
Implementing distributed mclock in cephImplementing distributed mclock in ceph
Implementing distributed mclock in ceph병수 박
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Ajeet Singh Raina
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaŁukasz Piątkowski
 
06 html5 and cocos2d-x
06   html5 and cocos2d-x06   html5 and cocos2d-x
06 html5 and cocos2d-x乐费 胡
 
Protecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on KubernetesProtecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on KubernetesDoKC
 
On-Demand Image Resizing Extended - External Meet-up
On-Demand Image Resizing Extended - External Meet-upOn-Demand Image Resizing Extended - External Meet-up
On-Demand Image Resizing Extended - External Meet-upJonathan Lee
 
The CAA-Record for increased encryption security
The CAA-Record for increased encryption securityThe CAA-Record for increased encryption security
The CAA-Record for increased encryption securityMen and Mice
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivAleksey Asiutin
 
from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?strikr .
 

Similar to Understanding Mobile Web Performance (20)

Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
 
Android Chromium Rendering Pipeline
Android Chromium Rendering PipelineAndroid Chromium Rendering Pipeline
Android Chromium Rendering Pipeline
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
COSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge BoxCOSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge Box
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Deep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm ModeDeep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm Mode
 
DevOpsDays Taipei 2017 從打鐵到雲端
DevOpsDays Taipei 2017 從打鐵到雲端DevOpsDays Taipei 2017 從打鐵到雲端
DevOpsDays Taipei 2017 從打鐵到雲端
 
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
KubeCon EU 2016: Using Traffic Control to Test Apps in KubernetesKubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
 
Implementing distributed mclock in ceph
Implementing distributed mclock in cephImplementing distributed mclock in ceph
Implementing distributed mclock in ceph
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing Aurea
 
06 html5 and cocos2d-x
06   html5 and cocos2d-x06   html5 and cocos2d-x
06 html5 and cocos2d-x
 
Protecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on KubernetesProtecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on Kubernetes
 
On-Demand Image Resizing Extended - External Meet-up
On-Demand Image Resizing Extended - External Meet-upOn-Demand Image Resizing Extended - External Meet-up
On-Demand Image Resizing Extended - External Meet-up
 
The CAA-Record for increased encryption security
The CAA-Record for increased encryption securityThe CAA-Record for increased encryption security
The CAA-Record for increased encryption security
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
 
from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?from Docker to Moby and back. what changed ?
from Docker to Moby and back. what changed ?
 

Recently uploaded

Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Which standard is best for your content?
Which standard is best for your content?Which standard is best for your content?
Which standard is best for your content?Rustici Software
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 

Recently uploaded (20)

Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Which standard is best for your content?
Which standard is best for your content?Which standard is best for your content?
Which standard is best for your content?
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 

Understanding Mobile Web Performance

  • 1. Understanding Mobile Web Browser Performance Rajiv Vijayakumar Qualcomm Incorporated QUALCOMM CONFIDENTIAL AND PROPRIETARY 1
  • 2. Topics § Mobile browser architecture § Mobile network latencies § Android HTTP: Parallel downloads and caching § Power consumption 2
  • 4. What is a “WebKit” Browser? 4
  • 6. Browser Architecture Layout Engine 5
  • 8. Browser Architecture JavaScript WebKit Engine 5
  • 9. Browser Architecture JavaScriptCore WebKit or V8 5
  • 10. Browser Architecture JavaScriptCore WebKit or V8 Rendering Networking 5
  • 11. Browser Architecture Browser UI JavaScriptCore WebKit or V8 Rendering Networking 5
  • 12. Android 6
  • 17. <img src="http://www.qualcomm.com/imgA.jpg"> DNS Time 96.16.97.9 www.qualcomm.com 8
  • 19. <img src="http://www.qualcomm.com/imgA.jpg"> DNS TCP Time SYN SYN/ACK 8
  • 21. <img src="http://www.qualcomm.com/imgA.jpg"> DNS TCP HTTP Time HTTP/1.1 200 OK GET /imgA.jpg 8
  • 22. <img src="http://www.qualcomm.com/imgA.jpg"> DNS TCP HTTP Time HTTP/1.1 200 OK GET /imgA.jpg 8
  • 23. Latencies in 3G/4G Networks 9
  • 24. Latencies in 3G/4G Networks § Initial connection setup: > 1s (on older 3G) 9
  • 25. Latencies in 3G/4G Networks § Initial connection setup: > 1s (on older 3G) § Round trip time (RTT): 80ms or higher (typically) § 100 - 200ms common 9
  • 26. RTTs at speed of light § San Diego – New York : ~26ms § San Diego – Johannesburg : ~110ms 10
  • 27. Every round trip is at least 80-100ms DNS TCP HTTP 11
  • 28. Every round trip is at least 80-100ms DNS TCP HTTP Including HTTP retrievals from a CDN 11
  • 29. DNS Every new lookup takes 1 RTT + Lookup Time Histogram of DNS Lookup Times 150 100 50 0 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 Seconds 12 Source: Data collected over 30 sites (280 domains) on Qualcomm corporate network
  • 30. Domain Sharding § Use of multiple domains (cdn1.domain.com, cdn2.domain.com) § Requests may not happen in parallel... 13
  • 31. Parallel Downloads 8 images across 2 domains cdn1.domain.com/img1A.png cdn2.domain.com/img2A.png cdn1.domain.com/img1B.png cdn2.domain.com/img2B.png cdn1.domain.com/img1C.png cdn2.domain.com/img2C.png cdn1.domain.com/img1D.png cdn2.domain.com/img2D.png 14
  • 32. Browsers typically use 4-6 sockets per host img1A img1B img1C cdn1 img1D img2A img2B img2C cdn2 img2D 15 t=0
  • 33. Android img1A img1D img1B img1C cdn1 img2A img2B img2C img2D cdn2 16
  • 34. Android img1A img1D img1B img1C cdn1 img2A img2B img2C img2D cdn2 16
  • 35. Android img1A img1B img1C cdn1 img2A cdn2 17
  • 36. Android img1A § “Thread per socket” model img1B cdn1 img1C § 4 HTTP threads img2A cdn2 17
  • 37. QUALCOMM CONFIDENTIAL AND PROPRIETARY 18 Source: DDMS (from Android SDK) connected to Android 2.3.3 emulator
  • 38. Android img1A § “Thread per socket” model img1B cdn1 img1C § 4 HTTP threads img2A cdn2 19
  • 39. Android img1A § “Thread per socket” model img1B cdn1 img1C § 4 HTTP threads § Only 4 sockets can have img2A outstanding HTTP requests cdn2 (“active”) 19
  • 40. Android img1A img1D img1B img1C cdn1 img2A img2B img2C img2D cdn2 20
  • 41. Android img2A img2B img2C img2D cdn2 20
  • 42. Android img2A img2B img2C img2D cdn2 Pipelining 20
  • 43. Android img2A img2B img2C img2D cdn2 Pipelining § Send multiple requests without waiting for each response § Responses must arrive in order 20
  • 44. Android img2A img2B img2C img2D cdn2 Pipelining § Send multiple requests without waiting for each response § Responses must arrive in order § Android pipelines up to 3 requests on each socket 20
  • 45. Pipelining § Not supported, or not enabled by default on most major browsers § Historically caused problems (e.g. due to badly behaving proxies) § Millions of Android devices actively using pipelining § Time to revisit... ? 21
  • 47. HTTP Caching § WebKit maintains a memory cache § Default size = 8 MB § Android has a persistent (file system) HTTP cache § Default size = 6 MB 22
  • 49. Cache Eviction § What gets evicted to make room? 23
  • 50. Cache Eviction § What gets evicted to make room? § Android policy: Prioritize base on expiration date § Far future expiration dates have higher priority § Evict lowest priority items first Expires:Wed, 09 Jun 2021 21:12:36 GMT 23
  • 51. Example of Cache Contents Visited several sites, read blog posts and linked articles etc. 24
  • 52. Example of Cache Contents Visited several sites, read blog posts and linked articles etc. sqlite3 webviewCache.db 'select expires from cache order by expires desc;' 24
  • 53. Example of Cache Contents Visited several sites, read blog posts and linked articles etc. sqlite3 webviewCache.db 'select expires from cache order by expires desc;' Expiration Year 2036 2035 ... 2011 24
  • 54. Example of Cache Contents Visited several sites, read blog posts and linked articles etc. sqlite3 webviewCache.db 'select expires from cache order by expires desc;' 200 Expiration Year 150 2036 Count 2035 100 ... 50 2011 0 2010 2020 2030 2040 24 Expiration Year
  • 55. § Cache eviction policy affects performance § Consider real-world cache occupancy when measuring cached page load performance 25
  • 56. Caveats § Devices can (and do!) differ from stock Android § Differences in: § Number of HTTP threads § Cache size and eviction algorithm § etc. 26
  • 57. Power What is the power drawn from the battery while loading a web page? 27
  • 58. Battery Current (mA) 28 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 59. 11s download (400mA) Baseline (200 mA) 10s idle (300mA) QUALCOMM CONFIDENTIAL AND PROPRIETARY 29 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 60. Power § Any network traffic brings up the radio for several seconds § Network dormancy timer: typically 10-15 seconds § Use long periods for any periodic Ajax calls etc. 30 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 61. TCP FINs and Power 31 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 62. TCP FINs and Power § Android closes TCP sockets after ~6s of inactivity § Sockets get closed at different times 31 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 63. TCP FINs and Power § Android closes TCP sockets after ~6s of inactivity § Sockets get closed at different times § Every socket close generates a TCP FIN § Extends the dormancy timer § Keeps the modem on for a 1-bit communication 31 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 64. TCP FINs and Power § Android closes TCP sockets after ~6s of inactivity § Sockets get closed at different times § Every socket close generates a TCP FIN § Extends the dormancy timer § Keeps the modem on for a 1-bit communication § Optimization: close all sockets after page load completes 31 Source: Power measurements made on MDP MSM8655™ running Android 2.3 over commercial 3G network
  • 65. JavaScript Performance § SunSpider benchmark numbers have improved dramatically in recent years § Android (Jun 2011) < 2.5s § Desktop Chrome (Sep 2008) ~2.8 s 32 Source: http://ejohn.org/blog/javascript-performance-rundown/
  • 68. Disclaimer QUALCOMM Incorporated 5775 Morehouse Drive San Diego, CA. 92121-1714 U.S.A. Copyright © 2011 Qualcomm Incorporated. All rights reserved. Not to be used, copied, reproduced in whole or in part, nor its contents revealed in any manner to others without the express written permission of Qualcomm. Qualcomm and MSM8655 are trademarks of Qualcomm Incorporated, registered in the United States. Other product and brand names may be trademarks or registered trademarks of their respective owners. Nothing in these materials is an offer to sell any of the components or devices referenced herein. Certain components for use in the U.S. are available only through licensed suppliers. Some components are not available for use in the U.S. 35