1. 6

This paper compares a large set of programming languages regarding their efficiency, including from an energetic point-of-view. Indeed, we seek to establish and analyze different rankings for programming languages based on their energy efficiency. The goal of being able to rank programming languages based on their energy efficiency is both recent, and certainly deserves further studies. We have taken rigorous and strict solutions to 10 well defined programming problems, expressed in (up to) 27 programming languages, from the well known Computer Language Benchmark Game repository. This repository aims to compare programming languages based on a strict set of implementation rules and configurations for each benchmarking problem. We have also built a framework to automatically, and systematically, run, measure and compare the energy, time, and memory efficiency of such solutions. Ultimately, it is based on such comparisons that we propose a series of efficiency rankings, based on single and multiple criteria.

Our results show interesting findings, such as how slower/faster languages can consume less/more energy, and how memory usage influences energy consumption. We also present a simple way to use our results to provide software engineers and practitioners support in deciding which language to use when energy efficiency is a concern.

In addition, we further validate our results and rankings against implementations from a chrestomathy program repository, Rosetta Code., by reproducing our methodology and benchmarking system. This allows us to understand how the results and conclusions from our rigorously and well defined benchmarked programs compare to those based on more representative and real-world implementations. Indeed our results show that the rankings do not change apart from one programming language.

  1.  

    1. 8

      previously, previously, previously, previously, previously, some of which were past work by the same authors

      1. 8

        Thank you. I disagree with the authors that the results are “interesting”, it all seems to come down to “if you use less CPU time you’ll use less power” and everything else is noise atop that. …Now I want to take their data and make a scatter-plot of time (across all cores) vs power, just so I can draw a heckin’ straight line through it for them.

        1. 8

          In this paper they determine that it’s not even time across cores, it’s basically just time – if a workload takes 1 minute on one core and 45 seconds on two cores the second one actually uses less energy than the first.

          From page 13:

          Further, on our machine, doubling the number of cores increases relative energy efficiency, provided throughput increases by at least 13%:

          [equation]

          In other words, parallelization overhead up to 87% is acceptable. On our experimental platform, aggressively parallelizing programs is nearly always an energy-efficient choice.

          1. 4

            if a workload takes 1 minute on one core and 45 seconds on two cores the second one actually uses less energy than the first.

            This must be qualified though. They get this result because other things in the computer system that use power, use more power in those 15 seconds than using an extra 30 seconds of CPU time. But if the system was going to remain on regardless after the task is done, no power was saved, and if there is other work to be done, it would then be more efficient to run that first workload in 60 seconds on one core, and another workload on the second core.

          2. 2

            The author did say that the correlation between time and energy is strong in one of the tables. And in another table they listed J/ms and it curiously varies from ~0.1 to ~0.4.

            1. 2

              Ayyy, I actually did this graph for their data in Table 3, check it out: https://alopex.li/data/Ranking%20Programming%20Languages%20by%20Energy%20Efficiency%20-%20Table%203.png You actually quite clearly get two trend lines, one about 0.015 J/ms and one about 0.035 J/ms. Now that’s some interesting science. I didn’t bother trying to figure out whether certain languages fit on certain trend lines, I wonder if they’re algorithmic/runtime style differences. They don’t seem to depend strongly on memory usage, but I would want to do more digging before saying for sure.

              They really need to turn it around and instead of asking “which programming languages use more power”, ask “what factors influence the power usage of programs”.

              Raw data: https://alopex.li/data/Ranking%20Programming%20Languages%20by%20Energy%20Efficiency.ods

            2. 1

              I haven’t read the paper, but if this is what it’s arguing then it’s incorrect. Memory bandwidth utilization is a major and growing factor in power consumption - at least for hyperscalers. I haven’t looked into this but imagine that GPUs/TPUs are a major factor as well.

          3. 2

            The whole thing depends on the accuracy of Intel’s “Running Average Power Limit” facility. Is it really that accurate?

            It would have been nice to see measurement of power draw from the wall too, since that’s what you pay for.

            1. 1

              Rubyists might be really offended at not being included in the Object-Oriented section of the “Languages sorted by paradigm” table, lol.