SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
Towards a Green Ranking for Programming Languages
1. Towards a Green Ranking for
Programming Languages
M. Couto, R. Pereira, F. Ribeiro, R. Rua, & J. Saraiva
Universidade do Minho & INESC Tec/HASLab
ruipereira@di.uminho.pt
greenlab.di.uminho.pt
4. Green Computing
4
Caught the attention of many companies allowing them to save:
“close to 50% of the energy costs of an organization can be attributed to
the IT departments”
- [PICMET, 2009]
“up to 90% of energy used by ICT hardware can be attributed to software”
- [The Greenhouse Gas Protocol Report, 2013]
5. Green Software
Reducing energy consumption through software analysis and optimization
Problem:
How to analyze
How to interpret
How to improve
5
6. Green Software
Problems (extended to programmers):
How to analyze
How to interpret
How to improve
6
Mining questions about software energy consumption
- [MSR’14]
Integrated energy-directed test suite optimization
- [ISTA’14]
Seeds: A software engineer’s energy-optimization decision
support framework - [ICSE’14]
7. Energy vs. Power
7
Power (w) – rate (or effort) at which that work is done
Energy (J) – amount of work done
Power can change constantly while Energy is the accumulation
Energy = Power x Seconds
Power
Energy
100W360,000 J = x 3,600s
8. Motivation
8
Understanding the energy efficiency of programming languages
Is a faster language always a more energy efficient one?
Are there languages which run slower while consuming less energy?
Which are the most energy efficient languages?
10. The Computer Language Benchmarks Game (CLBG)
10
Project to compare programming languages
28 different programming languages
13 different benchmarks
Experts compete to code the fastest solution
Same underlying algorithms
Publicly available:
Source Code
Compiler Versions
Optimization Flags
Comparable and easily replicable programs/solutions!
12. 12
Running Average Power Limit
Designed by intel for i5/i7 architectures (SandyBridge, IvyBridge, Haswell, etc)
Monitors energy consumption info for Machine-Specific Registers (MSRs)
Allows very precise and fine-grain measurements through function calls
DRAM/GPU
CPU
Package
What is RAPL?
Energy Measurements
13. 13
Execution
Linux Ubuntu 16.0 4.8.0-22-generic
16GB Ram
Intel(R) Core(TM) i5-4460 CPU @ 3.40GHz
Compiler versions: https://sites.google.com/view/energy-efficiency-languages/setup
Compile
10 Languages x 10 Benchmarks = 100 Results
-> Run -> Measure
19. 19
Wrap Up
Initial starting place for a ranking of programming languages
Unexpected results
Time and Energy are not always proportional
C is still the King
20. 20
Wrap Up
Initial starting place for a ranking of programming languages
Unexpected results
Time and Energy are not always proportional
C is still the King
Future Work
Compare energy efficiency of the remaining 17 languages
Measure DRAM consumption
Understand DRAM consumption relation with memory usage
Best language for energy, time, and memory?
21. 21
Energy Efficiency Across Programming Languages – SLE’17
* https://sites.google.com/view/energy-efficiency-languages
22. Towards a Green Ranking for
Programming Languages
M. Couto, R. Pereira, F. Ribeiro, R. Rua, & J. Saraiva
Universidade do Minho & INESC Tec/HASLab
ruipereira@di.uminho.pt
greenlab.di.uminho.pt
Notas del editor
Come to a better realization of what we have been doing to the environment
Patterns, habits, structures algorithms
Aware of the energy consumption problem,
many times seeking help in resolving this,
misconceptions
within the programming community as to what causes highenergy
consumption, how to solve them
a heavy lack of support and knowledge for energy-aware development
So for this we need to be able to first obtain comparable solutions
In order to compare (both in terms of execution time and energy consumption) different languages, we need solutions/programs for the same problems expressed in each of those languages.
Developing comparable programs written in different languages is both complex and time consuming.
Ranging from hashtable updates, DNA sequence scans, binary tree traversals etc.
Essentially the exact commands to run the programs as they were submitted to produce the most efficient solutions
It isn’t novel to use CLBG, it has been used countless amount of times in other research for comparing languages (usually for performance)
Threads
Distribution of atleast atleast one paradigm and had 100% code submission coverage
The faster is not always the most energy efficient. (Fortran)
Lua and Jruby and Perl
Java has higher energy consumption than Ocaml, yet it is faster
Lua and Perl also show this example
C# 4x more energy than C. 9x more to finish (Not always directly proportional )
Looking at the ratios, the previous comments are further strengthened. While in most cases faster is greener, the Energy equation also depends on Power, and as we can see this ratio is rarely constant and thus we can understand how this is not purely a performance issue
The three interpreted languages Lua Jruby and Perl have a tendency to not only be the slowest but more energy consuming.
Even so, Lua tends to be the slowest while consuming less. Roughly 12% slower than perl and 53% less energy
Here we can also clearly see C dominates followed by Java.
Ocaml Fortran and Lua are more energy efficient than performance efficient, and C# Go Jruby and Perl are the other way around