What Do Programmers Know about
Software Energy Consumption?
by Candy Pang, Abram Hindle,
Bram Adams and Ahmed E. Hassan
IEEE Software Magazine May/June 2016
Feature: Green Software
P.2 © Candy Pang
• Mobile device
o Affect battery life and limits
device use.
• Data center
o Limit the number of
machines that can be run
and cooled.
o For every $1.00 spent on
new hardware, an additional
$0.50 is spent on power and
cooling [1].
Why do we care about software energy consumption?
P.3 © Candy Pang
• Are programmers aware of software energy
consumption?
• What do they know about reducing energy
consumption?
• What’s their level of knowledge about energy
consumption?
• What do they think that causes high energy
consumption?
What do we want learn?
P.4 © Candy Pang
• Survey programmers
What do programmers know about Software
Energy Consumption?
1 2 3 4 5 6 7 8 9 10 11 12 13
2
3
4
5
6
7
8
9
10
122 survey respondents
4 interviewees
Programming
Learn
Programming
Coding
Android
Developers
Computer
Science
Java
Tiny Code
P.5 © Candy Pang
There are 4 groups of questions in the survey:
1. Respondents’ demographics
2. Respondents’ understanding by ranking
3. Respondents’ awareness by Yes/No
4. Respondents’ knowledge by open text
Survey methodology
P.6 © Candy Pang
P.7 © Candy Pang
• How many years of programming experience do you
have?
Programmers Demographics:
0
5
10
15
20
25
30
No.ofRespondents
P.8 © Candy Pang
• How would you rank your programming skill –
beginner, intermediate, or advanced?
Programmers Demographics:
0
10
20
30
40
50
60
70
Advance Intermediate Beginner
No.ofRespondents
P.9 © Candy Pang
• In what programming language are you most
proficient? [10]
Programmers Demographics:
0
5
10
15
20
25
30
No.ofRespondents
67% cloud
programmers
use Java [11]
TIOBE[10]
P.10 © Candy Pang
• Using social media
• Balancing survey length and data gathered
• Missing questions, like …
o Program Types (e.g. mobile app, web app)
o Programmer’s Roles (e.g. designer, tester)
o Programmer’s Domains (e.g. game, health)
• Neglecting other non-functional requirements
(e.g. performance, security, and usability)
Survey Limitations
P.11 © Candy Pang
• Do you take power
consumption into
account when
developing software?
• Is minimizing power
consumption a
requirement or a concern
of your software?
Finding 1: Programmers have limited awareness
of software energy consumption
18% 82%
YES NO
14% 86%
YES NO
P.12 © Candy Pang
• Have you modified your
software to reduce power
consumption?
• Have users complained
about your software’s
power consumption?[6]
Finding 1: Programmers have limited awareness
of software energy consumption
21% 79%
YES NO
3% 97%
YES NO
P.13 © Candy Pang
• Have you measured your
software’s power consumption?
• If yes, how do you measure it?
Finding 2: Programmers lack knowledge of
reducing software energy consumption
How to measure? # of Res
Power meter 6
Battery 4
Power supply 3
Resource measurement 2
Software tool 2
CPU time 1
10% 90%
YES NO
P.14 © Candy Pang
• Would power consumption be
one of your decision factors
when choosing a mobile
development platform?
Finding 2: Programmers lack knowledge of
reducing software energy consumption
65% 35%
YES NO
P.15 © Candy Pang
• How would you improve your software’s power
efficiency?
Finding 2: Programmers lack knowledge of
reducing software energy consumption
How to reduce software energy? # of Res
Better algorithm 19
Less computation 11
Improve network access 10
Better I/O access 9
Sleep 9
Improve graphic handling 9
Avoid pull or poll 8
Test and improve 6
Improve caching 6
P.16 © Candy Pang
• How would you improve your software’s power
efficiency?
Finding 2: Programmers lack knowledge of
reducing software energy consumption
How to reduce software energy? # of Res
Better hardware 5
Improve multithreading 4
Task bundling 2
Avoid sensor 2
Less user interaction 1
Parallelism 1
Virtualization 1
Use native code 1
P.17 © Candy Pang
• For desktop computers, rank the software power
consumption.
• For mobile devices, rank the software power
consumption.
The expected ranking are [4.7.8]:
Finding 3: Programmers lack knowledge of
software energy consumption
Desktop Mobile-device
1. CPU 1. Screen and GPU
2. Hard drive 2. CPU
3. Screen and GPU 3. Network
4. Network 4. Storage device
5. Memory 5. Memory
P.18 © Candy Pang
Finding 3: Programmers lack knowledge of
software energy consumption
0
10
20
30
40
50
60
70
80
90
100
1st 2nd 3rd 4th 5th
#ofParticipants
(a) Desktop Computer Components Ranked by
Energy Consumption
CPU
Hard Disk
Screen & GPU
Network
Memory
P.19 © Candy Pang
Finding 3: Programmers lack knowledge of
software energy consumption
0
10
20
30
40
50
60
70
80
90
100
1st 2nd 3rd 4th 5th
#ofParticipants
(b) Mobile Device Components Ranked by Energy
Consumption
Screen & GPU
CPU
Network
Storage Device
Memory
P.20 © Candy Pang
• Used Spearman’s rank correlation to compared the
respondents’ rankings against each other.
Finding 3: Programmers lack knowledge of
software energy consumption
Desktop
Correlation 0.3
Std. Dev. 0.48
Mobile Device
Correlation 0.6
Std. Dev. 0.32
P.21 © Candy Pang
• What software functions have higher power
consumption?
Finding 4: Programmers are unaware of software
energy consumption’s causes
Causes of energy consumption # of Res
Graphics 35
Computation 30
Network 19
Media access 10
Pulling or polling 6
Sensor 4
Bad algorithm 3
P.22 © Candy Pang
• What software functions have higher power
consumption?
Finding 4: Programmers are unaware of software
energy consumption’s causes
Causes of energy consumption # of Res
Memory 1
Threading 1
Antivirus 1
P.23 © Candy Pang
• Pinto et al. identified 7 causes of unnecessary
software energy consumption [3]:
1. unnecessary resource use,
2. faulty GPS behavior,
3. background activities,
4. excessive synchronization,
5. background wallpapers,
6. advertisements, and
7. high GPU use.
Finding 4: Programmers are unaware of software
energy consumption’s causes
network
sensor
threading
pulling or polling
graphics
graphics
P.24 © Candy Pang
Increase user awareness …
Future works
[9]
P.25 © Candy Pang
Estimate actual software energy consumption …
Future works
P.26 © Candy Pang
Motivate programmers to enhance software’s energy
efficiency for sustainability …
Future works
Service Bill:
• Disk $$$
• CPU $$$
• Mem $$$
• Net $$$
• Energy $$$
P.27 © Candy Pang
Create tools to identify unnecessary energy consumption
and suggest how to reduce consumption …
Future works
V2V1Source
Code
Energy
efficiency
suggestions
Energy
efficiency
comparison
P.28 © Candy Pang
Educate programmers …
• Pinto et al. identified 8 strategies to reduce software
energy consumption [3]
o Minimizing IO
o Bulk operations
o Avoid polling
o Hardware coordination
o Concurrent programming
o Lazy initialization
o Race to idle
o Efficient data structure
Future works
P.29 © Candy Pang
1. Programmers have limited awareness of software
energy consumption
2. Programmers lack knowledge of reducing software
energy consumption
3. Programmers lack knowledge of software energy
consumption
4. Programmers are unaware of software energy
consumption’s causes
Conclusion
P.30 © Candy Pang
1. J. Scaramella and M. Eastwood, Solutions for the
Datacenter’s Thermal Challenges, white paper, IDC, Jan.
2007; http://ecoinfo.cnrs.fr/IMG/pdf/idc_WHITE_PAPER_-
_Solutions_for_the_Datacenter_s_Thermal_Challenges_.
pdf.
2. B. Göetz et al., Java Concurrency in Practice, Addison-
Wesley, 2006.
3. G. Pinto, F. Castor, and Y.D. Liu, “Mining Questions about
Software Energy Consumption,” Proc. 11th Working
Conf. Mining Software Repositories, 2014, pp. 22–31.
4. A. Hindle, “Green Mining: A Methodology of Relating
Software Change to Power Consumption,” Proc. 9th
Working Conf. Mining Software Repositories (MSR 12),
2012, pp. 78–87.
References
P.31 © Candy Pang
5. P. Kurp, “Green Computing,” Comm. ACM, vol. 51, no. 10,
2008, pp. 11–13.
6. H. Khalid et al., “What Do Mobile App Users Complain
About?,” IEEE Software, vol. 32, no. 3, 2015, pp. 70–77.
7. D. Li et al., “An Empirical Study of the Energy
Consumption of Android Applications,” Proc. IEEE Int’l
Conf. Software Maintenance and Evolution, 2014, pp.
121–130.
8. A. Banerjee et al., “Detecting Energy Bugs and Hotspots
in Mobile Apps,” Proc. 22nd ACM SIGSOFT Int’l Symp.
Foundations of Software Eng., 2014, pp. 588–598.
9. C. Zhang, A. Hindle, and D.M. Germán, “The Impact of
User Choice on Energy Consumption,” IEEE Software,
vol. 31, no. 3, 2014, pp. 69–75.
References
P.32 © Candy Pang
10. TIOBE http://www.tiobe.com/index.php/tiobe_index.
11. The DZone Guide to Building and Deploying Application
on the Cloud (Volume III);
https://dzone.com/storage/assets/1996686-dzone-
buildinganddeployinginthecloud.pdf.
References
P.33 © Candy Pang
Full survey details, data, and analysis can be found online:
http://webdocs.cs.ualberta.ca/~hindle1/2014/green-
programmers
Green Software Survey
Candy
Pang
Abram
Hindle
Bram
Adams
Ahmed E.
Hassan

What Do Programmers Know about Software Energy Consumption?

  • 1.
    What Do ProgrammersKnow about Software Energy Consumption? by Candy Pang, Abram Hindle, Bram Adams and Ahmed E. Hassan IEEE Software Magazine May/June 2016 Feature: Green Software
  • 2.
    P.2 © CandyPang • Mobile device o Affect battery life and limits device use. • Data center o Limit the number of machines that can be run and cooled. o For every $1.00 spent on new hardware, an additional $0.50 is spent on power and cooling [1]. Why do we care about software energy consumption?
  • 3.
    P.3 © CandyPang • Are programmers aware of software energy consumption? • What do they know about reducing energy consumption? • What’s their level of knowledge about energy consumption? • What do they think that causes high energy consumption? What do we want learn?
  • 4.
    P.4 © CandyPang • Survey programmers What do programmers know about Software Energy Consumption? 1 2 3 4 5 6 7 8 9 10 11 12 13 2 3 4 5 6 7 8 9 10 122 survey respondents 4 interviewees Programming Learn Programming Coding Android Developers Computer Science Java Tiny Code
  • 5.
    P.5 © CandyPang There are 4 groups of questions in the survey: 1. Respondents’ demographics 2. Respondents’ understanding by ranking 3. Respondents’ awareness by Yes/No 4. Respondents’ knowledge by open text Survey methodology
  • 6.
  • 7.
    P.7 © CandyPang • How many years of programming experience do you have? Programmers Demographics: 0 5 10 15 20 25 30 No.ofRespondents
  • 8.
    P.8 © CandyPang • How would you rank your programming skill – beginner, intermediate, or advanced? Programmers Demographics: 0 10 20 30 40 50 60 70 Advance Intermediate Beginner No.ofRespondents
  • 9.
    P.9 © CandyPang • In what programming language are you most proficient? [10] Programmers Demographics: 0 5 10 15 20 25 30 No.ofRespondents 67% cloud programmers use Java [11] TIOBE[10]
  • 10.
    P.10 © CandyPang • Using social media • Balancing survey length and data gathered • Missing questions, like … o Program Types (e.g. mobile app, web app) o Programmer’s Roles (e.g. designer, tester) o Programmer’s Domains (e.g. game, health) • Neglecting other non-functional requirements (e.g. performance, security, and usability) Survey Limitations
  • 11.
    P.11 © CandyPang • Do you take power consumption into account when developing software? • Is minimizing power consumption a requirement or a concern of your software? Finding 1: Programmers have limited awareness of software energy consumption 18% 82% YES NO 14% 86% YES NO
  • 12.
    P.12 © CandyPang • Have you modified your software to reduce power consumption? • Have users complained about your software’s power consumption?[6] Finding 1: Programmers have limited awareness of software energy consumption 21% 79% YES NO 3% 97% YES NO
  • 13.
    P.13 © CandyPang • Have you measured your software’s power consumption? • If yes, how do you measure it? Finding 2: Programmers lack knowledge of reducing software energy consumption How to measure? # of Res Power meter 6 Battery 4 Power supply 3 Resource measurement 2 Software tool 2 CPU time 1 10% 90% YES NO
  • 14.
    P.14 © CandyPang • Would power consumption be one of your decision factors when choosing a mobile development platform? Finding 2: Programmers lack knowledge of reducing software energy consumption 65% 35% YES NO
  • 15.
    P.15 © CandyPang • How would you improve your software’s power efficiency? Finding 2: Programmers lack knowledge of reducing software energy consumption How to reduce software energy? # of Res Better algorithm 19 Less computation 11 Improve network access 10 Better I/O access 9 Sleep 9 Improve graphic handling 9 Avoid pull or poll 8 Test and improve 6 Improve caching 6
  • 16.
    P.16 © CandyPang • How would you improve your software’s power efficiency? Finding 2: Programmers lack knowledge of reducing software energy consumption How to reduce software energy? # of Res Better hardware 5 Improve multithreading 4 Task bundling 2 Avoid sensor 2 Less user interaction 1 Parallelism 1 Virtualization 1 Use native code 1
  • 17.
    P.17 © CandyPang • For desktop computers, rank the software power consumption. • For mobile devices, rank the software power consumption. The expected ranking are [4.7.8]: Finding 3: Programmers lack knowledge of software energy consumption Desktop Mobile-device 1. CPU 1. Screen and GPU 2. Hard drive 2. CPU 3. Screen and GPU 3. Network 4. Network 4. Storage device 5. Memory 5. Memory
  • 18.
    P.18 © CandyPang Finding 3: Programmers lack knowledge of software energy consumption 0 10 20 30 40 50 60 70 80 90 100 1st 2nd 3rd 4th 5th #ofParticipants (a) Desktop Computer Components Ranked by Energy Consumption CPU Hard Disk Screen & GPU Network Memory
  • 19.
    P.19 © CandyPang Finding 3: Programmers lack knowledge of software energy consumption 0 10 20 30 40 50 60 70 80 90 100 1st 2nd 3rd 4th 5th #ofParticipants (b) Mobile Device Components Ranked by Energy Consumption Screen & GPU CPU Network Storage Device Memory
  • 20.
    P.20 © CandyPang • Used Spearman’s rank correlation to compared the respondents’ rankings against each other. Finding 3: Programmers lack knowledge of software energy consumption Desktop Correlation 0.3 Std. Dev. 0.48 Mobile Device Correlation 0.6 Std. Dev. 0.32
  • 21.
    P.21 © CandyPang • What software functions have higher power consumption? Finding 4: Programmers are unaware of software energy consumption’s causes Causes of energy consumption # of Res Graphics 35 Computation 30 Network 19 Media access 10 Pulling or polling 6 Sensor 4 Bad algorithm 3
  • 22.
    P.22 © CandyPang • What software functions have higher power consumption? Finding 4: Programmers are unaware of software energy consumption’s causes Causes of energy consumption # of Res Memory 1 Threading 1 Antivirus 1
  • 23.
    P.23 © CandyPang • Pinto et al. identified 7 causes of unnecessary software energy consumption [3]: 1. unnecessary resource use, 2. faulty GPS behavior, 3. background activities, 4. excessive synchronization, 5. background wallpapers, 6. advertisements, and 7. high GPU use. Finding 4: Programmers are unaware of software energy consumption’s causes network sensor threading pulling or polling graphics graphics
  • 24.
    P.24 © CandyPang Increase user awareness … Future works [9]
  • 25.
    P.25 © CandyPang Estimate actual software energy consumption … Future works
  • 26.
    P.26 © CandyPang Motivate programmers to enhance software’s energy efficiency for sustainability … Future works Service Bill: • Disk $$$ • CPU $$$ • Mem $$$ • Net $$$ • Energy $$$
  • 27.
    P.27 © CandyPang Create tools to identify unnecessary energy consumption and suggest how to reduce consumption … Future works V2V1Source Code Energy efficiency suggestions Energy efficiency comparison
  • 28.
    P.28 © CandyPang Educate programmers … • Pinto et al. identified 8 strategies to reduce software energy consumption [3] o Minimizing IO o Bulk operations o Avoid polling o Hardware coordination o Concurrent programming o Lazy initialization o Race to idle o Efficient data structure Future works
  • 29.
    P.29 © CandyPang 1. Programmers have limited awareness of software energy consumption 2. Programmers lack knowledge of reducing software energy consumption 3. Programmers lack knowledge of software energy consumption 4. Programmers are unaware of software energy consumption’s causes Conclusion
  • 30.
    P.30 © CandyPang 1. J. Scaramella and M. Eastwood, Solutions for the Datacenter’s Thermal Challenges, white paper, IDC, Jan. 2007; http://ecoinfo.cnrs.fr/IMG/pdf/idc_WHITE_PAPER_- _Solutions_for_the_Datacenter_s_Thermal_Challenges_. pdf. 2. B. Göetz et al., Java Concurrency in Practice, Addison- Wesley, 2006. 3. G. Pinto, F. Castor, and Y.D. Liu, “Mining Questions about Software Energy Consumption,” Proc. 11th Working Conf. Mining Software Repositories, 2014, pp. 22–31. 4. A. Hindle, “Green Mining: A Methodology of Relating Software Change to Power Consumption,” Proc. 9th Working Conf. Mining Software Repositories (MSR 12), 2012, pp. 78–87. References
  • 31.
    P.31 © CandyPang 5. P. Kurp, “Green Computing,” Comm. ACM, vol. 51, no. 10, 2008, pp. 11–13. 6. H. Khalid et al., “What Do Mobile App Users Complain About?,” IEEE Software, vol. 32, no. 3, 2015, pp. 70–77. 7. D. Li et al., “An Empirical Study of the Energy Consumption of Android Applications,” Proc. IEEE Int’l Conf. Software Maintenance and Evolution, 2014, pp. 121–130. 8. A. Banerjee et al., “Detecting Energy Bugs and Hotspots in Mobile Apps,” Proc. 22nd ACM SIGSOFT Int’l Symp. Foundations of Software Eng., 2014, pp. 588–598. 9. C. Zhang, A. Hindle, and D.M. Germán, “The Impact of User Choice on Energy Consumption,” IEEE Software, vol. 31, no. 3, 2014, pp. 69–75. References
  • 32.
    P.32 © CandyPang 10. TIOBE http://www.tiobe.com/index.php/tiobe_index. 11. The DZone Guide to Building and Deploying Application on the Cloud (Volume III); https://dzone.com/storage/assets/1996686-dzone- buildinganddeployinginthecloud.pdf. References
  • 33.
    P.33 © CandyPang Full survey details, data, and analysis can be found online: http://webdocs.cs.ualberta.ca/~hindle1/2014/green- programmers Green Software Survey Candy Pang Abram Hindle Bram Adams Ahmed E. Hassan