***Winner of the distinguished paper award of MobileSoft'17***
"Assessing the Impact of Service Workers on the Energy Efficiency of Progressive Web Apps"
by Ivano Malavolta, Giuseppe Procaccianti, Paul Noorland, Petar Vukmirovic
MobileSoft'17, Buenos Aires, Argentina, 2017
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
Assessing the Impact of Service Workers on the Energy Efficiency of Progressive Web Apps
1. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Ivano Malavolta
Giuseppe Procaccianti
Paul Noorland
Petar Vukmirovic ́
VRIJE
UNIVERSITEIT
AMSTERDAM
Assessing the Impact of Service Workers on the
Energy Efficiency of Progressive Web Apps
Buenos Aires, 22 May 2017
VRIJE
UNIVERSITEIT
AMSTERDAM
2. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
BROWSER
<html>
<head>
<script src=” ...” />
</head>
<body>
...
NATIVE
APP
01010101010101101010
1010101011011010
010101010101011101
010101010101011010
PLATFORM APIs
Native Web
Mobile development strategies
Progressive
(PWA)
BROWSER
<html>
<head>
<script src=” ...” />
</head>
<body>
...
Service
workers
3. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Service worker
Implemented in JavaScript
Multithreading
→ it runs in a separate thread w.r.t.
the main thread
Used for:
• push notifications
• background operations
• content caching
– offline functionality
4. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Offline-first experience
Web App
Service
worker
response
response
request
Backend
Offline cache
this.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request).then(function(response){
return response || fetch(event.request);
});
);
});
5. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Goal of this work
PWAs + service workers have been advertised as:
• performance boosters
• network savers
• providers of better UX
However…
How does the use of service workers impact the
energy efficiency of PWAs under different network
conditions?
How does the use of service workers impact the
energy efficiency of PWAs?RQ1
RQ2
6. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Subjects selection
• Real apps from the pwa.rocks1 repository
• Pseudo-random selection
– no toy examples
– data-driven PWAs (e.g., no videogames)
1 https://pwa.rocks
Name Category Total size SW size (loc)
Ali Express Shopping 2.1Mb 69
Google I/O 2016 Events 4.2Mb 358
The Washington Post News 4.0Mb 85
Flipkart Shopping 3.8Mb 907
Babe News News 1.2Mb 156
Wiki offline Knowledge 800Kb 1009
The Billings Gazette News 2.1Mb 60
7. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Experiment design
Independent variables:
Dependent variable:
energy consumption of the device in Joules
Experiment design:
• full 2x2x2 factorial à all possible combinations of treatments
• 8 combinations x 7 PWAs x 8 runs à 448 runs
• each run executes a typical usage scenario (10-15 gestures)
Variable name Treatments
SW status <on, off>
Android device <high-end, low-end>
Network condition <2G, WiFi>
8. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Experiment execution
Orchestration
script
Monkey-
runner
Trepn
profiler
Chrome
Monkeyrunner
1. HTTP requests
impersonating phone
2. HTTP responses (recorded)
9. save
collected
data
3. Start experiment run
5. start 6. start
7a. HTTP
requests as part
of the scenario
7b. HTTP
responses
(possibly altered)
8. collect data
Fiddler
proxy
Hosted
PWA
ADB
OS
4. start
scenario
run
9. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Results
Overall energy consumption across devices
Low-end High-end
High difference across devices
à we use the type of
device as blocking factor
10. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Results (RQ1)
Results of the ANOVA test on all the factors
Factors Sum of
squares
F value p-value
Service workers (SW) 98.15 0.11 0.75
Network conditions 3164.28 3.41 0.07
Device type 67974.31 73.33 <0.05
SW:network 66.93 0.07 0.79
We cannot claim that service workers influence the energy
consumption of a PWA running on a mobile device
11. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Results (RQ1)
Let’s look at how service workers impact energy consumption on the
specific devices...
Low-end High-end
Difference in energy consumption in high-end
device – extremely minimal (0.42 J)
The high-end device consumes less energy
12. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Results (RQ2) – network conditions
High-end
+ 2G
Low-end
+ 2G
Low-end
+ WiFi
High-end
+ WiFiPWAs consume less energy on WiFi
Same device + same network condition à low impact of SWs
13. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
PWA-specific trends
Low-end
2G
WiFi
High-endDifferent PWAs
à different impact
of SWs
Same PWA
à SWs have a
different impact
under different
conditions
- - - - + + +
+
-
+
14. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Manual review of SW source code
Conjecture = specific implementation of each SW may be a
confounding factor
No specific trend here
Name Listened
events
Caching Obfuscation/
minification
Complexity
Ali Express P, N ✓ ✓ 12
Google I/O 2016 I, A, F, M ✓ 9
The Washington Post I, A, P, N ✓ 131
Flipkart I, A, F ✓ ✓ 5
Babe News I, A, F, P, N ✓ 16
Wiki offline I, A, F, S, M, N ✓ ✓ 7
The Billings Gazette I, A, F ✓ 194
15. VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Conclusions
VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Goal of this work
PWAs have been advertised as:
• performance boosters
• network savers
• providers of better UX
However…
How does the use of service workers impact the
energy efficiency of PWAs under different network
conditions?
How does the use of service workers impact the
energy efficiency of PWAs?RQ1
RQ2
VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Results (RQ1)
Results of the ANOVA test on all the factors
Factors Sum of
squares
F value p-value
Service workers (SW) 98.15 0.11 0.75
Network conditions 3164.28 3.41 0.07
Device type 67974.31 73.33 <0.05
SW:network 66.93 0.07 0.79
We cannot claim that service workers influence the energy
consumption of a PWA running on a mobile device
VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Backup slides
• Accuracy of Trepn profiler: close to 99%
– Hoque, Mohammad Ashraful, et al. "Modeling, profiling, and
debugging the energy consumption of mobile devices." ACM
Computing Surveys (CSUR) 48.3 (2016): 39.
VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Experiment execution
Orchestration
script
Monkey-
runner
Trepn
profiler
Chrome
Monkeyrunner
1. HTTP requests
impersonating phone
2. HTTP responses (recorded)
9. save
collect
data
3. Start experiment run
5. start 6. start
7a. HTTP
requests as part
of the scenario
7b. HTTP
responses
(possibly altered)
8. collect data
Fiddler
proxy
Hosted
PWA
ADB
OS
4. start
scenario
run
VRIJE
UNIVERSITEIT
AMSTERDAM
Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
PWA-specific trends
Low-end
2G
WiFi
High-endDifferent PWAs
à different impact
of SWs
Same PWA
à different impact of
SWs under different
conditions
- - - - + + +
+
-
+
16. Malavolta et al. – MOBILESoft, 22nd May 2017, Buenos Aires
Contact
Ivano Malavolta |
Assistant professor
Vrije Universiteit Amsterdam
iivanoo
i.malavolta@vu.nl
www.ivanomalavolta.com