|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Energy Languages||484||2 years ago||5||mit||C|
|The complete set of tools for energy consumption analysis of programming languages, using Computer Language Benchmark Game|
|Mlstyle.jl||376||2 months ago||37||mit||Julia|
|Julia functional programming infrastructures and metaprogramming facilities|
|Babelstream||280||3 days ago||25||other||C++|
|STREAM, for lots of devices written in many programming models|
|Bosatsu||220||7 days ago||109||apache-2.0||Scala|
|A python-ish pure and total functional programming language|
|Sortingalgorithm.hayateshiki||82||5 years ago||1||mit||C++|
|Hayate-Shiki is an improved merge sort algorithm with the goal of "faster than quick sort".|
|Asprilo||27||2 years ago||5||mit||Python|
|🤖 ASPRILO, an intra-logistics benchmark suite for answer set programming|
|Haskell Programming From First Principles||22||3 years ago||bsd-3-clause||Haskell|
|Notes and solutions to exercises of "Haskell Programming from first principles"|
|Performance testing for different techniques|
|7guis||13||a year ago||1||Go|
|Fyne implementation of 7GUIs: A GUI Programming Benchmark - https://eugenkiss.github.io/7guis/|
|Benchmark||12||20 days ago||mit||Dockerfile|
|Some benchmark tests for different programming languages|
This repo contains the source code of 10 distinct benchmarks, implemented in 28 different languages (exactly as taken from the Computer Language Benchmark Game).
It also contains tools which provide support, for each benchmark of each language, to 4 operations: (1) compilation, (2) execution, (3) energy measuring and (4) memory peak detection.
This framework follows a specific folder structure, which guarantees the correct workflow when the goal is to perform and operation for all benchmarks at once. Moreover, it must be defined, for each benchmark, how to perform the 4 operations considered.
Next, we explain the folder structure and how to specify, for each language benchmark, the execution of each operation.
The main folder contains 32 elements:
compile_all.py, capable of building, running and measuring the energy and memory usage of every benchmark in all considered languages.
RAPLsub-folder, containing the code of the energy measurement framework.
gen-input.sh, used to generate the input files for 3 benchmarks:
Basically, the directories tree will look something like this:
| ... | <Language-1> | <benchmark-1> | <source> | Makefile | [input] | ... | <benchmark-i> | <source> | Makefile | [input] | ... | <Language-i> | <benchmark-1> | ... | <benchmark-i> | RAPL | compile_all.py | gen-input.sh
C language as an example, this is how the folder for the
k-nucleotide benchmarks would look like:
| ... | C | binary-trees | binarytrees.gcc-3.c | Makefile | k-nucleotide | knucleotide.c | knucleotide-input25000000.txt | Makefile | ... | ...
Each benchmark sub-folder, included in a language folder, contains a
This is the file where is stated how to perform the 4 supported operations: (1) compilation, (2) execution, (3) energy measuring and (4) memory peak detection.
Makefile must contains 4 rules, one for each operations:
||This rule specifies how the benchmark should be compiled in the considered language; Interpreted languages don't need it, so it can be left blank in such cases.|
||This rule specifies how the benchmark should be executed; It is used to test whether the benchmark runs with no errors, and the output is the expected.|
||This rule shows how to use the framework included in the
To better understand it, here's the
Makefile for the
binary-trees benchmark in the
compile: /usr/bin/gcc -pipe -Wall -O3 -fomit-frame-pointer -march=native -fopenmp -D_FILE_OFFSET_BITS=64 -I/usr/include/apr-1.0 binarytrees.gcc-3.c -o binarytrees.gcc-3.gcc_run -lapr-1 -lgomp -lm measure: sudo ../../RAPL/main "./binarytrees.gcc-3.gcc_run 21" C binary-trees run: ./binarytrees.gcc-3.gcc_run 21 mem: /usr/bin/time -v ./binarytrees.gcc-3.gcc_run 21
First things first: We must give sudo access to the energy registers for RAPL to access
sudo modprobe msr
and then generate the input files, like this
This will generate the necessary input files, and are valid for every language.
We included a main Python script,
compile_all.py, that you can either call from the main folder or from inside a language folder, and it can be executed as follows:
python compile_all.py [rule]
You can provide a rule from the available 4 referenced before, and the script will perform it using every
Makefile found in the same folder level and bellow.
The default rule is
compile, which means that if you run it with no arguments provided (
python compile_all.py) the script will try to compile all benchmarks.
The results of the energy measurements will be stored in files with the name
<language> is the name of the running language.
You will find such file inside of corresponding language folder.
benchmark-name ; PKG (Joules) ; CPU (J) ; GPU (J) ; DRAM (J) ; Time (ms)
Do note that the availability of GPU/DRAM measurements depend on your machine's architecture. These are requirements from RAPL itself.
test-benchmark, inside the language you implemented it.
compile_all.pyscript to compile, run, and/or measure what you want! Or run it yourself using the
Wanna know more? Check this website!
There you can find the results of a successful experimental setup using the contents of this repo, and the used machine and compilers specifications.
You can also find there the paper which include such results and our discussion on them:
"Energy Efficiency across Programming Languages: How does Energy, Time and Memory Relate?", Rui Pereira, Marco Couto, Francisco Ribeiro, Rui Rua, Jácome Cunha, João Paulo Fernandes, and João Saraiva. In Proceedings of the 10th International Conference on Software Language Engineering (SLE '17)
Makefiles have specified, for some cases, the path for the language's compiler/runner.
It is most likely that you will not have them in the same path of your machine.
If you would like to properly test every benchmark of every language, please make sure you have all compilers/runners installed, and adapt the