Skip to content

Comparator of energy footprints of multiple languages through programs executing the same task. The tool used to perform the comparison is PowerAPI (http://powerapi.org/). Results can be viewed in the file https://github.com/sallareznov/gc-levenshtein/blob/master/report.pdf

Notifications You must be signed in to change notification settings

sallareznov/gc-levenshtein

Repository files navigation

Codacy Badge Code Climate

EnergyFootprint

Energy footprint of the Levenshtein distance computing algorithm

Author

(You can read the full report with the results by browsing the file (report.pdf).

The goal

The goal of this project is to measure and compare energy footprints of multiple languages through programs executing the same task.

The tool

To get those metrics, the project uses PowerAPI, a middleware toolkit for building software-defined power meters. Software-defined power meters are configurable software libraries that can estimate the power consumption of software in real-time.

The algorithm

This algorithm, implemented in multiple languages, reads a dictionary of words in a text file (one word per line), and calculates the Levenshtein distance between all consecutive words. This computation is done in two ways : recursively, and iteratively (using dynamic programming).

Every program takes one argument, which is a file path of a dictionary containing one word per line.

  • reads a file containing one word per line
  • for every pair of consecutive words, calculates the Levenshtein distance recursively and iteratively.

The design of the program is the following :

UML

The algorithm follows this flowchart :

FlowChart

The program

Every implemented program requires one argument, referencing the dictionary of words (one word per line). For example, to use the program implemented in Ocaml with the dictionary file in the repository, you have to execute the following commands :

$ cd ocaml
$ make
$ ./levenshtein ../dictionary.txt

The languages

In alphabetical order, the algorithm is implemented in :

  • C
  • Go
  • Java
  • Ocaml
  • Python
  • Scala

About

Comparator of energy footprints of multiple languages through programs executing the same task. The tool used to perform the comparison is PowerAPI (http://powerapi.org/). Results can be viewed in the file https://github.com/sallareznov/gc-levenshtein/blob/master/report.pdf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published