How far can client-only solutions go for mobile browser speed? Zhen - - PowerPoint PPT Presentation
How far can client-only solutions go for mobile browser speed? Zhen - - PowerPoint PPT Presentation
How far can client-only solutions go for mobile browser speed? Zhen Wang , Felix Xiaozhu Lin, Lin Zhong, Mansoor Chishtie Rice Efficient Computing Group - http://recg.org Mobile browsers are slow Average browser delay: 5 seconds Commercial
Mobile browsers are slow
- Average browser delay: 5 seconds
- Commercial impact
– Google: 500 ms => 20% traffic loss – Amazon: 100 ms => 1% sales loss
2
- R. Kohavi, R. M. Henne, and D. Sommerfield, "Practical guide to controlled experiments
- n the web: listen to your customers not to the hippo," in Proceedings of the 13th ACM
SIGKDD international conference on Knowledge discovery and data mining, 2007.
Why is mobile browser slow?
3
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
Why is mobile browser slow?
4
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
Why is mobile browser slow?
5
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
Why is mobile browser slow?
6
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
Why is mobile browser slow?
7
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 Scripting
Why is mobile browser slow?
8
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
Subresources
Why is mobile browser slow?
9
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
Rendering
Why is mobile browser slow?
10
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.
Computation does not matter
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
Speed up layout operation Shrink green boxes…
Computation does not matter
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
Shift to the left Shrink
Computation does not matter
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
Shift to the left Shrink They will not move
Computation does not matter
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
Original
Computation does not matter
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
Original
After shrink and shift
New
Resource loading matters
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
Long network round trip time (RTT)
Resource loading matters
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
So many resources are needed …
- JavaScript, CSS, image files
Existing solutions
- Infrastructure support
–Difficult to deploy –Depend on server or proxy capability –Violate end-to-end security
18
Client-only approaches
–Caching –Prefetching
19
Client-only approaches
–Caching –Prefetching
20
Understanding mobile users
- 24 iPhone 3GS users
- Feb. 2010 to Feb. 2011
- Timestamp and URL
21
Understanding mobile users
- Top 10 websites account for over 80% of visits
- 75% of the webpage visits are first-time
- 65% of the subresource visits are re-visits
22
Client-only approaches
–Caching –Prefetching
23
Caching is not effective
- Theory: Cache helps by reducing network activity
- Reality:
70% of resource requests incur network activity
– Half of them are due to cache revalidation – Cache revalidation saves bandwidth, not RTT
24
Web prefetching
25
Predict and download the right webpage while the user is still reading the left webpage.
Web prefetching is not effective
- Browser delay reduction: 1%
- Unnecessary data usage: 84%
- Reason
– 75% of webpage visits are first-time – > hard to predict the next visit
26
Existing client-only solutions
- Caching is not effective
– Resources quickly expire and need revalidation
- Web prefetching is even harmful
– User behavior is not very predictable
27
Existing client-only solutions
- Caching is not effective
– Resources quickly expire and need revalidation
- Web prefetching is even harmful
– User behavior is not very predictable
28
Our insight
29
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
Our insight
30
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
Our insight
31
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
Single network connection for
- ver 2 seconds!
Our insight
32
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
Single network connection for
- ver 2 seconds!
Our insight
33
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
Single network connection for
- ver 2 seconds!
Speculative loading
34
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
Speculative loading
35
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
Speculative loading
36
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
Browser Delay Reduction
Speculative loading
37
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
Browser Delay Reduction
How is a website structured?
38
Website Node Subdomain Node Webpage Node Subresource Node
shared by multiple webpages
How is a website structured?
39
Website Node Subdomain Node Webpage Node Subresource Node
shared by multiple webpages More sharing -> Easier subresource prediction
How is a website structured?
40
Website Node Subdomain Node Webpage Node Subresource Node
shared by multiple webpages More sharing -> Easier subresource prediction
76% of the subresources of a webpage are shared by other webpages in the same website.
Predict webpages a user will visit User behavior prediction Predict subresources a webpage will need Server behavior prediction
41
Web prefetching vs. Speculative loading
Predict webpages a user will visit User behavior prediction Predict subresources a webpage will need Server behavior prediction
42
Web prefetching vs. Speculative loading
Much easier!
Predict webpages a user will visit User behavior prediction Predict subresources a webpage will need Server behavior prediction
43
Web prefetching vs. Speculative loading
Much easier!
75% 35% Webpage Subresource
First-time visits
How much can speculative loading speed up a mobile browser?
–Upper bound through simulation –Real world measurement
44
Upper bound of improvement
45
3.2 s 3.2 s 6.3 s 4.3 s 6.7 s 4.6 s Legacy Speculative Fresh Cache Expired Cache Empty Cache
Upper bound of improvement
46
3.2 s 3.2 s 6.3 s 4.3 s 6.7 s 4.6 s Legacy Speculative Fresh Cache Expired Cache Empty Cache
Upper bound of improvement
47
3.2 s 3.2 s 6.3 s 4.3 s 6.7 s 4.6 s Legacy Speculative Fresh Cache Expired Cache Empty Cache
Upper bound of improvement
48
3.2 s 3.2 s 6.3 s 4.3 s 6.7 s 4.6 s Legacy Speculative Fresh Cache Expired Cache Empty Cache
Realistic Cache 1.4 s (22%)
49
Tempo
A speculative mobile browser
Tempo architecture
50
Temporary Cache WebKit
Rest of the Android mobile browser
Update Service Speculative Loader Metadata Repository Cache Tempo Enhancement
51
Temporary Cache Update Service Speculative Loader Metadata Repository
Store each website’s resource graph Predict and load subresources speculatively Update and trim metadata repository Store resources with “no-cache” header
Tempo architecture
52
Temporary Cache Update Service Speculative Loader Metadata Repository
Website Resource graph google.com Google resource graph … … cnn.com CNN resource graph
Website node
Metadata Repository
Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image) Type: Website URL: cnn.com Last visit time Children: … Type: Subdomain URL: m.cnn.com Last visit time Children: … Type: Webpage URL: http://m.cnn.com/... Last visit time Children: … Type: Subresource URL: … Last visit time Parents: … Number of visits
53
Speculative Loader Metadata Repository
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
Temporary Cache Update Service
54
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- Revisit
Speculative Loader Metadata Repository Temporary Cache Update Service
55
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- Revisit
Speculative Loader Metadata Repository Temporary Cache Update Service
56
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- Revisit
Speculative Loader Metadata Repository Temporary Cache Update Service
57
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- First-time visit
Speculative Loader Metadata Repository Temporary Cache Update Service
58
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- First-time visit
Speculative Loader Metadata Repository Temporary Cache Update Service
59
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- First-time visit
Speculative Loader Metadata Repository Temporary Cache Update Service
60
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- First-time visit
Speculative Loader Metadata Repository Temporary Cache Update Service
61
Website node Subdomain nodes Webpage nodes Sub-resource nodes (JavaScript, CCS, Image)
- Input: URL of the webpage
- Output: predicted subresources
- First-time visit
Speculative Loader Metadata Repository Temporary Cache Update Service
62
Rank subresources
– Number of parents (large > small) – File types (JS > CSS > image) – Number of visits (large > small) – URL length (short > long)
Speculative Loader Metadata Repository Temporary Cache Update Service
Evaluation of Tempo
–Subresource prediction –Browser delay reduction –Overhead
63
Subresource prediction
64
Requested Predicted
Subresource prediction
65
Requested Predicted Requested & Predicted
High prediction accuracy
66
Requested Requested & Predicted 79%
High browser delay reduction
Predicted
High prediction accuracy
67
Predicted Requested & Predicted 70%
Low additional data usage
Requested
Browser delay reduction
- Lab experiments
–Webpage revisits –First-time visits
- Field trial
68
Webpage revisits
69
4.4 s 4.3 s 6 s 4.6 s 6.7 s 5.2 s Legacy Tempo Fresh Cache Expired Cache Empty Cache
Webpage revisits
70
4.4 s 4.3 s 6 s 4.6 s 6.7 s 5.2 s Legacy Tempo Fresh Cache Expired Cache Empty Cache
Webpage revisits
71
4.4 s 4.3 s 6 s 4.6 s 6.7 s 5.2 s Legacy Tempo Fresh Cache Expired Cache Empty Cache
Webpage revisits
72
4.4 s 4.3 s 6 s 4.6 s 6.7 s 5.2 s Legacy Tempo Fresh Cache Expired Cache Empty Cache
Realistic Cache 1 s (20%)
4.5 s 4.3 s 4.6 s 3.6 s 6.9 s 5.8 s Legacy Tempo Fresh Cache Expired Cache Empty Cache
First-time visits
73
Field trial
- First week
– Start with empty cache – Enable speculative loading
- Second week
– Keep the warm cache – Disable speculative loading
- The benefit we attribute to speculative loading
will be unlikely from the caching effect
74
Field trial
75
3.9 s 4.3 s 1st Week 2nd Week With speculative loading Without speculative loading
Field trial
- Speculative loading needs some time to
construct the resource graph…
- How about 5 days’ training?
76
Field trial
77
2.9 s 4.3 s Day 6 & 7 of 1st Week 2nd Week With speculative loading Without speculative loading
Low overhead
- Prediction Error
– Occupy TCP connection (still > 1s reduction) – Additional data usage (< 1MB per week)
- Storing metadata repository
– Additional storage (< 200KB after a year)
78
Conclusion
- Client-only solutions can reduce mobile browser
delay by 1.4 second at most
- Tempo, a speculative mobile browser, can reduce
mobile browser delay by 1 second (~20%)
– Google: increase 40% traffic – Amazon: increase 10% sales
79
Conclusion
- Client-only solutions can reduce mobile browser
delay by 1.4 second at most
- Tempo, a speculative mobile browser, can reduce
mobile browser delay by 1 second (~20%)
– Google: increase 40% traffic – Amazon: increase 10% sales
80