SlideShare ist ein Scribd-Unternehmen logo
1 von 68
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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 .
 

Ähnlich wie 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 ?
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

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