C Is The Greenest Programming Language

Have you ever wondered if there is a correlation between a computer’s energy consumption and the choice of programming languages? Well, a group of Portuguese university researchers did and set out to quantify it. Their 2017 research paper entitled Energy Efficiency across Programming Languages / How Do Energy, Time, and Memory Relate?  may have escaped your attention, as it did ours.

Abstract: This paper presents a study of the runtime, memory usage and energy consumption of twenty seven well-known soft- ware languages. We monitor the performance of such lan- guages using ten different programming problems, expressed in each of the languages. Our results show interesting find- ings, such as, slower/faster languages consuming less/more energy, and how memory usage influences energy consump- tion. We show how to use our results to provide software engineers support to decide which language to use when energy efficiency is a concern.

While we might take issue with some of the programming languages selected as being “well known”, the project was very thorough and quite well documented. Most people would take for granted that a computer program which runs faster will consume less energy. But this might not always be true, as other factors enter into the power consumption equation besides speed. The team used a collection of ten standard algorithms from the Computer Language Benchmarks Game project (formerly known as The Great Computer Language Shootout) as the basis for their evaluations.

Last year they updated the functional language results, and all the setups, benchmarks, and collected data can be found here. Check out the paper for more details. Have your choice of programming language ever been influenced by energy consumption?

Harvesting And Graphing Wireless Household Utility Meter Info

Both our electrical meter and our gas meter are located in the basement of our house (we recently had the gas meter moved outside though). When people see this they always ask if the meter readers have to come inside once a month. The answer is no, these meters broadcast usage data which is picked up once a month when a utility company vehicle drives down the street. If you have wireless meters in your house, here’s a way to harvest and graph the wireless data so that you can analyze your usage patterns.

The hardware used here is a special USB dongle. This has a 900 MHz radio which picks out the packets from a reasonably large list of meter types, and pushes them through the USB interface. In the image above you can see that an Arduino with a USB host shield is used, but there are also drivers if you want to connect this directly to your computer.

We looked around and didn’t find any specifics on the hardware used on that board. But it can’t be all that hard to make one of these at home… the populated board seems to have just two ICs and a few passive components. Anyone up to the challenge of hacking together their own packet sniffer? We wonder if the Next HOPE badge could pull down the data?

[Thanks Chris]