Why are Web Browsers Slow on Smartphones? Zhen Wang (Rice) Felix - - PowerPoint PPT Presentation
Why are Web Browsers Slow on Smartphones? Zhen Wang (Rice) Felix - - PowerPoint PPT Presentation
Why are Web Browsers Slow on Smartphones? Zhen Wang (Rice) Felix Xiaozhu Lin (Rice) Lin Zhong (Rice) Mansoor Chishtie (TI) WINDOW TO THE CLOUD 2 Mobile browsers are slow 17 sec Nexus One (N1) HTC Dream (G1) 13 sec 12 sec 8 sec Top 10
WINDOW TO THE CLOUD
2
Mobile browsers are slow
3
8 sec 13 sec 12 sec 17 sec Top 10 Mobile Website Top10 Non-mobile Webpage Nexus One (N1) HTC Dream (G1)
- What does the browser show?
- How does the browser work?
- Where is the bottleneck?
4
What does the browser show?
0% 20% 40% 60% 80% 100%
1 25 25 iPhone 3GS Users Non-mobile webpages Mobile webpages
5
avg
How does the browser work?
Scripting Style Formatting HTML Parsing
Loaded resources Update IR
Layout
Graphics
Painting
New resources to load
Resource Loading
Internal Representation (IR)
......
6
IR operations: Parsing, Style, Scripting, Layout, Painting
Where is the bottleneck?
- Existing work on PC browsers
– Layout – Style formatting – Scripting
7
- 1. C. Stockwell, "IE8 Performance," http://blogs.msdn.com/b/ie/archive/2008/08/26/ie8-performance.aspx, 2008.
- 2. L. A. Meyerovich and R. Bodik, "Fast and parallel webpage layout," in Proc. Int. Conf. World Wide Web (WWW) Raleigh, North Carolina, USA: ACM, 2010.
- 3. K. Zhang, L. Wang, A. Pan, and B. B. Zhu, "Smart caching for web browsers," in Proc. Int. Conf. World Wide Web (WWW) Raleigh, North Carolina, USA: ACM, 2010.
8
Is it true for mobile browsers?
Layout, Style, Scripting
Performance characterization
- Metric: browser delay
– Starting point: when the user presses the “GO” button of the browser to open an URL. – End point: when the browser’s page loading progress bar indicates 100%.
9
Performance characterization
- Dependency timeline characterization
- What-if analysis
10
Dependency timeline characterization
11
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
Dependency timeline characterization
12
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
request
Dependency timeline characterization
13
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
redirection
Dependency timeline characterization
14
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
Data packets
Dependency timeline characterization
15
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
This is part of resource loading. It is mainly spent on network.
Glue operation
Dependency timeline characterization
16
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
Dependency timeline characterization
17
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
intra-group dependency
Dependency timeline characterization
18
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
inter-group dependency
What overall performance gain will be achieved if a browser
- peration is accelerated?
19
What-if analysis
20
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style Shrink
What-if analysis
21
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style Shift to the left Shrink
What-if analysis
22
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style They will not move Shrink Shift to the left
What-if analysis
23
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
What-if analysis
24
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
Original
What-if analysis
25
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style
Original New
Experimental setup
- Platform:
– HTC Dream (G1): 528MHz – Nexus One (N1): 1GHz
- Operating System
– Android 2.1 (Eclair)
- Benchmark Webpages:
– Top 10 mobile websites – Top 10 visited non-mobile webpages from LiveLab
26
1.Nielsen.com, "Top mobiel phones, sites and brands for 2009," http://blog.nielsen.com/nielsenwire/online_mobile/top-mobile-phones-sites-and-brands-for-2009/, 2009. 2.C. Shepard, A. Rahmati, C. Tossell, L. Zhong, and P. Kortum, "Live- Lab: Measuring Wireless Networks and Smartphone Users in the Field," in Proc. Workshop on Hot Topics in Measurement & Model-ing of Computer Systems, June 2010.
Experimental setup
- We used three network
conditions:
– Emulated enterprise Ethernet (no traffic control) – Typical 3G network (T-mobile) – Emulated adverse network
- First-hop RTT: 400ms
- Bandwidth (downlink/uplink):
500Kbps/100Kbps
27
Logging information
- Time stamp for browser operations
– Overhead: <1%
- Tcpdump
– Overhead: <2% (CPU); <0.4% (MEM)
28
Results
two take-away messages
29
IR operations do not matter much!
Parsing, Style, Scripting, Layout, Painting
30
IR operations do not matter much
0% 2% 4% 8 16 24 32 Overall Improvement Layout Calculating Speedup
Layout
Non-mobile Web Mobile Web 0% 2% 4% 8 16 24 32 Overall Improvement Style Formatting Speedup
Style
Non-mobile Web Mobile Web 0% 2% 4% 8 16 24 32 Overall Improvement Scripting Speedup
Script
Non-mobile Web Mobile Web
31
IR operations do not matter much
0% 2% 4% 8 16 24 32 Overall Improvement Layout Calculating Speedup
Layout
Non-mobile Web Mobile Web 0% 2% 4% 8 16 24 32 Overall Improvement Style Formatting Speedup
Style
Non-mobile Web Mobile Web 0% 2% 4% 8 16 24 32 Overall Improvement Scripting Speedup
Script
Non-mobile Web Mobile Web
32
IR operations do not matter much
0% 2% 4% 6% 8% 8 16 24 32
Overall Improvement Speedup Combined: Parsing, Layout, Style, Scripting, Painting, Glue
Non-mobile Web Mobile Web
33
Resource loading is the bottleneck!
34
Resource loading is the bottleneck
35
0% 200% 400% 600% 8 16 24 32 Overall Improvement Resource Loading Speedup
Resource Loading
Non-mobile Web Mobile Web
Resource loading is the bottleneck
36
0% 200% 400% 600% 8 16 24 32 Overall Improvement Resource Loading Speedup
Resource Loading
Non-mobile Web Mobile Web
Resource loading is the bottleneck
- Network RTT
- Network Bandwidth
- Browser loading procedure
- Processing power
37
Network RTT matters
10 20 30 200 400 Browser Delay (sec) Injected RTT (ms)
G1 - Non-mobile Web N1 - Non-mobile Web G1 - Mobile Web N1 - Mobile Web
38
3G
Network bandwidth doesn’t matter
10 20 30 250/50 500/100 1000/200 1500/400 Browser Delay (sec) Bandwidth: Downlink/Uplink (Kbps)
G1 - Non-mobile Web N1 - Non-mobile Web G1 - Mobile Web N1 - Mobile Web
39
3G
Browser loading procedure
40
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style New resources can only be discovered after parsing a loaded resource
Browser loading procedure
41
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style Redirections on the main HTML file further delay the discovering time of later resources
Browser loading procedure
42
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000 3500 4000
5 6 7 8
Scripting Layout Resource Loading Painting Parsing Style Parsing of the HTML file is blocked by JavaScripts
Browser loading procedure
- Up to 25 concurrent requests for top
mobile/non-mobile webpages
- Constrains on concurrent TCP connections
43
Mobile Browser Connections/hostname Maximum connections Android 4 4 iPhone 4.3 6 35 Blackberry 9700 4 16 Opera Mobile 4 4 Opera Mini 10 60
http://www.browserscope.org/
Average number of resources
44
22 96 Top 10 Mobile Website Top10 Non-mobile Webpage
Average number of network round trips
45
19 27 Top 10 Mobile Website Top10 Non-mobile Webpage
Processing power in resource loading
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000
5 6 7 8 9
Scripting Layout Resource Loading Painting Parsing Style http://mail.yahoo.com
46
This is part of resource loading. It is mainly spent on network.
Processing power in resource loading
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000
5
(i)
6 7 8 9
DNS lookup query
Scripting Layout Resource Loading Painting Parsing Style http://mail.yahoo.com
47
Processing power in resource loading
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000
5
(i) (ii)
6 7 8 9
DNS lookup query TCP connection established HTTP GET sent out
Scripting Layout Resource Loading Painting Parsing Style http://mail.yahoo.com
48
Processing power in resource loading
Elapsed time (ms)
1 2 3 4
Resource Group
0 1000 1500 2000 2500 3000
5
(i) (ii) (iii)
6 7 8 9
DNS lookup query TCP connection established HTTP GET sent out
Scripting Layout Resource Loading Painting Parsing Style http://mail.yahoo.com
49
50
126ms 13ms 98ms 40ms 3ms 18ms (i) (ii) (iii) G1 N1
Time spent by G1 and N1 for those three cases
Total time spent in the three cases on average when opening a mobile webpage
51
2 sec 1 sec G1 N1
Processing power in resource loading
- Other uncategorized processing
– The OS moves the data from network stack to browser after receiving data packets – Computation for secure connection (HTTPS)
52
More powerful hardware improves the browser delay mainly through faster OS services and network stack instead of faster IR operations.
53
Performance characterization results
- IR operations do not matter much
- Resource loading is the bottleneck
– Network RTT (X) – Network bandwidth – Browser loading procedure (X) – Processing power (X)
54
How to improve mobile browser’s performance?
Reduce RTT
- Cloudlet
- Data staging
Reduce # of Round Trips
- Web Pre-fetching
- Resource batching
- Data URI scheme
- Speculative resource
loading
55
1.M. Satyanarayanan, P. Bahl, R. Caceres, and N. Davies, "The Case for VM-Based Cloudlets in Mobile Computing," IEEE Pervasive Computing, vol. 8, pp. 14-23, 2009. 2.J. Flinn, S. Sinnamohideen, N. Tolia, and M. Satyanaryanan, "Data Staging on Untrusted Surrogates," in Proceedings of the 2nd USENIX Conference on File and Storage Technologies San Francisco, CA: USENIX Association, 2003. 3.V. N. Padmanabhan and J. C. Mogul, "Using predictive prefetching to improve World Wide Web latency," SIGCOMM Comput. Commun. Rev., vol. 26, pp. 22-36, 1996. 4.Skyfire: http://www.skyfire.com/. 5.L. Masinter, "The "data" URL scheme," http://tools.ietf.org/html/rfc2397, 1998.
On-going work
- Speculative mobile browser design
- Fully understand the impact of hardware
- OS and network service acceleration
56
http://www.owlnet.rice.edu/~zw3/projects_Tempo.html
57
Benchmark webpages
mobile
http://maps.google.com http://www.espn.com http://www.cnn.com http://www.google.com http://mail.yahoo.com http://mail.google.com http://www.weather.com http://www.facebook.com http://www.hotmail.com http://mail.aol.com
Non-mobile
http://freeappaday.com/ https://owlspace-ccm.rice.edu/portal http://www.restaurant.com/ http://www.neopets.com/games/ http://arstechnica.com/ http://houston.craigslist.org/ http://houston.varsitytutors.com/ http://www.morewords.com/ http://tripplanner.ridemetro.org/hiwire http://registrar.rice.edu/
58