How 27 programming languages differ in energy consumption

Posted on Monday, July 14, 2025 by RUSS SCRITCHFIELD, Writer

A research team from Portugal has conducted a comprehensive study analyzing how different programming languages impact energy consumption, execution time, and memory usage. Their findings were published in the paper Energy Efficiency Across Programming Languages, as reported by technology news outlet The New Stack.

The Most Energy-Efficient Programming Languages Revealed: How 27 programming languages differ in energy consumption

The study evaluated 27 programming languages by running solutions to 10 standard algorithmic problems sourced from the Computer Language Benchmarks Game (CLBG), a free software project designed to compare performance across languages. This allowed researchers to assess the energy usage, speed, and memory footprint of each language under consistent conditions.

The tests were executed on a Linux Ubuntu Server 16.10 system with a Haswell Intel Core i5-4460 CPU and 16GB of RAM. Power consumption was measured using Intel's Running Average Power Limit tool, with each program run 10 times to ensure consistent and reliable results.

C and Rust Among the Most Energy Efficient

The results confirmed that the C language remains both the fastest and the most energy-efficient overall. However, performance varied depending on the specific task. For example, when scanning a DNA database for a genetic sequence, Rust outperformed other languages in energy efficiency, while C ranked third for energy usage and second for speed.

Fortran also demonstrated strong energy efficiency in certain tests, though its execution time was slower compared to other top performers.

Speed Does Not Always Equal Lower Energy Use

The researchers challenged the assumption that faster programs inherently consume less energy. Their data showed that execution speed and energy consumption do not always correlate. In one benchmark, a program written in Chapel executed 55 percent faster than its Pascal equivalent, yet the Pascal program used 10 percent less energy.

The study further revealed that, on average, the CPU accounted for 88 percent of power consumption, regardless of whether programs were compiled, interpreted, or run on a virtual machine. Interpreted languages showed more variability in CPU energy use, ranging from 81.57 percent to 92.90 percent.

Compiled Languages Outperform in Energy and Speed

Compiled languages, including C, Rust, C++, and Ada, dominated both energy efficiency and execution speed metrics. On average, compiled languages consumed just 120 joules (J) to execute solutions, compared to 576J for virtual machine languages and 2365J for interpreted languages.

The top five most energy-efficient and fastest languages included:

  • C (57J, 2019ms)
  • Rust (59J, 2103ms)
  • C++ (77J, 3155ms)
  • Ada (98J, 3740ms)
  • Java (114J, 3821ms)
     

In contrast, interpreted languages such as Lua, Python, Perl, Ruby, and TypeScript were found to be the slowest and most energy-consuming.

Memory Usage Reflects Similar Trends

Compiled languages also proved to be more memory-efficient. Pascal, Go, C, Fortran, and C++ required the least memory, with Pascal using just 66 megabytes (MB). Interpreted languages, including JRuby, Dart, Lua, and Perl, occupied the bottom rankings for memory usage, with some requiring over 400MB.

When analyzed by programming paradigm, imperative languages were the most efficient in both energy consumption and execution time. Programs written in imperative languages used an average of 125J and executed in 5585 milliseconds, significantly outperforming object-oriented, functional, and scripting paradigms.

No Universal Best Language

Despite these findings, the researchers emphasized that no single language consistently outperforms others across all scenarios. Factors such as compiler quality, libraries used, and specific application requirements all influence energy consumption and performance.

In scenarios where both energy use and execution time are critical, C emerged as the best overall option. When considering energy and memory usage together, C and Pascal were the top choices. For developers optimizing across all three metrics—energy, time, and memory—C, Pascal, and Go were identified as strong candidates.

Further Research and Practical Applications

The study's data has been made publicly available to support further research into energy-efficient programming. The findings have particular relevance for developers working on mobile apps, IoT devices, and other applications where power consumption is a major constraint.

The research offers valuable insights but also underscores the complexity of the topic. As the authors conclude, “The situation on which a language is going to be used is a core aspect to determine if that language is the most energy-efficient option.”

Full coverage of the study was provided by David Cassel for The New Stack. Cassel has covered technology news for over two decades, contributing to outlets such as CNN, MSNBC, and the Wall Street Journal Interactive.

How 27 programming languages differ in energy consumption



Normalized global results for energy time and memory

More App Developer News

Ludo.ai Unveils API and MCP Beta to Power AI Game Asset Pipelines



AccuWeather Launches ChatGPT Integration for Live Weather Updates



Stop Using Business Jargon: 5 Ways Buzzwords Damage Job Performance



IT spending rises as banks balance legacy and innovation



Tech hiring slumps as Software Developer job postings fall



AI is becoming more widespread in collaboration tools



FCC prohibits new foreign router models citing critical infrastructure risks



ChatGPT Carbon Footprint Matches 1.3 Million Cars Report Finds



Lens Launches MCP Server to Connect AI Coding Assistants with Kubernetes



Accelerating corporate ai investment returns



Enviromates tech startup launches global participation platform



Private Repository Secures the AI-driven Development Boom



UK Fintech Platform Enviromates Connects Projects Brands and Consumers



Env Zero and CloudQuery Announce Merger



How Industrial AI Is Transforming Operations in 2026



AI generated work from managers is damaging trust among employees



Foresight Secures $25M to Bridge Infrastructure Execution Gap



UNESCO AI initiatives driving sustainable development in Africa



What can you build with ChatGPT in 48 hours



env zero and CloudQuery merge



China is accelerating the next phase of AI



The Second Product: Scaling means rebuilding what you already shipped



Avocado Health introduces AI-Powered text coaching for parents



Gaming goes permanent as Pokemon tops global tattoo trends



Sinch introduces agentic conversations to power enterprise AI engagement



Copyright © 2026 by Moonbeam

Address:
1855 S Ingram Mill Rd
STE# 201
Springfield, Mo 65804

Phone: 1-844-277-3386

Fax:417-429-2935

E-Mail: contact@appdevelopermagazine.com