Skip to content

Repository files navigation

Towards a More Accurate Understanding of Programming Language Energy Efficiency

This repository is the research artifact for a Master's thesis on the energy efficiency of programming languages. It runs a fixed suite of benchmarks across many languages under a hardware-based energy-measurement tool and feeds the results into a reproducible data-analysis pipeline.

The thesis argument, interpretation, and conclusions belong to the dissertation itself. This README only describes what the repository contains and how to run it.

Overview

The project measures 18 programming languages, grouped into 3 execution compilers, on 8 core benchmarks from the Computer Language Benchmarks Game (CLBG). Energy and performance are measured by the Green Metrics Tool (GMT), and the measurements are exported, cleaned, and analysed into per-language results.

Execution Model Languages
AOT C, C++, C#, Dart, Go, Haskell, Java, OCaml, Rust, Swift
JIT Erlang, F#, JavaScript (Node.js), Ruby
Interpreted Lua, Perl, PHP, Python

Benchmarks: binary-trees, fannkuch-redux, fasta, k-nucleotide, mandelbrot, n-body, regex-redux, spectral-norm.

Repository Layout

  • benchmarks/<lang>/ — one GMT YAML per language × benchmark. <benchmark>.yml is the canonical run; <benchmark>_test.yml is a fast smoke test on smaller inputs. Each YAML declares a Docker service (with setup-commands for compilation) and a timed flow.
  • inputs/ — shared fasta input files mounted into the containers; generated by scripts/generate_inputs.sh (run automatically during make setup).
  • scripts/measure.sh (orchestrates GMT runs), merge_results.py (merges the per-language CSVs), setup.sh / uninstall.sh, and generate_inputs.sh.
  • kwa/ — Go CLI ("KWA") that reads measurements out of GMT's Postgres database and exports them to CSV. See kwa/README.md.
  • notebooks/ — Jupyter notebooks for cleaning, energy/time analysis, and cross-language comparison (v1 plus a regenerated v2/ set).
  • results/ — CSV outputs of the pipeline (raw and cleaned).
  • docs/ — compiler flags, per-language CLBG implementation notes, and methodology.
  • green-metrics-tool/ — GMT itself, cloned locally by make setup (not committed).

Quick Start

Linux only (Ubuntu 22.04 / 24.04). Bootstrap the environment, then run a measurement:

make setup            # full local env (Docker, GMT, Go, Python) — see docs/setup.md
make measure lang=go  # measure one language — see docs/usage.md

Measurements flow through export → merge → clean into results/; see docs/pipeline.md.

Documentation

References

[0] green-metrics-tool

[1] clbg

About

Master's thesis focused on measuring the energy consumption and execution time of programming languages through the Green Metrics Tool, followed by a statistical analysis of the collected data.

Resources

Stars

Watchers

Forks

Contributors

Languages