Banks and other financial institutions like to make a big deal about their environmental efforts through their ESG teams, but that doesn’t mean they’re climatically benign. Their engineering teams are generating big emissions merely through the code they write.
A 2017 paper published alongside the ACM SIGPLAN Engineering Language Conference tested a number of the most prevalent programming languages in use today to determine, among other things, how much energy they used. The results showed that Python, despite its popularity was a massive energy hog using 45 times as much energy (4390 joules) as C++ (77 joules) to execute its programs.
Top 5 Most Energy Efficient Programming Languages
| C | 57 | 2,019 |
|---|---|---|
| Rust | 59 | 2,103 |
| C++ | 77 | 3,155 |
| Ada | 98 | 3,740 |
| Java | 114 | 3,821 |
Top 4 Least Energy Efficient Programming Languages
| Perl | 4,604 | 132,856 |
|---|---|---|
| Python | 4,390 | 145,178 |
| Ruby | 4,045 | 119,832 |
| Lua | 2,660 | 167,416 |
Python is an interpreted language. While compiled languages like Ada, C++ and Rust directly translate to instructions for the machine, Python must be read by a separate program first before being translated into machine instructions. Interpreted languages are generally far easier to learn and simpler to use, but this comes at the cost of energy in a big way.
Python is very well-loved in finance. Investment firm Man Group for example have called it the “second language” of the firm. On eFinancialCareers, of the 5,072 jobs currently available for quants and technologists, 1217 mention Python. If not Python, most banks like using alternative interpreted languages; Goldman Sachs’ love affair with Slang, is well documented.
The same phenomenon can also be seen in fintech. Stripe, for example, relies heavily on Ruby, which is only narrowly faster than Python. If this evident energy gap exists in small, optimized benchmarking programs, one can only imagine how much additional energy is produced in Stripe’s 50 million lines of code.
C++ may be kind on the environment, but it is far from kind on its developers. C++ is very difficult to work with by nature, which is what makes its elite engineers so valuable to hedge funds and high frequency trading firms. Rust, on the other hand, is similarly energy efficient, but is known for being a lot more enjoyable to work with. However, it lacks a serious presence in finance beyond some crypto roles.
The most peculiar phenomenon is Java. The only language in the top five for energy consumption not to be a pure-compiled language. While it is somewhat low level and capable of ultra low-latency code, Java also operates using the Java Virtual Machine (JVM) which makes it much easier for developers to work with.
Original Source: Python is 57x slower than C++ (and 45x worse for the planet)
Never Miss an Update
Get notified when we publish new analysis on HFT, market microstructure, and electronic trading infrastructure. No spam.
Subscribe by EmailI help financial institutions architect high-frequency trading systems that are fast, stable, and profitable.
I have operated on both the Buy Side and Sell Side, spanning traditional asset classes and the fragmented, 24/7 world of Digital Assets.
I lead technical teams to optimize low-latency infrastructure and execution quality. I understand the friction between quantitative research and software engineering, and I know how to resolve it.
Core Competencies:
â–¬ Strategic Architecture: Aligning trading platforms with P&L objectives.
â–¬ Microstructure Analytics: Founder of VisualHFT; expert in L1/L2/LOB data visualization.
â–¬ System Governance: Establishing "Zero-Failover" protocols and compliant frameworks for regulated environments.
I am the author of the industry reference "C++ High Performance for Financial Systems".
Today, I advise leadership teams on how to turn their trading technology into a competitive advantage.
Key Expertise:
â–¬ Electronic Trading Architecture (Equities, FX, Derivatives, Crypto)
â–¬ Low Latency Strategy & C++ Optimization | .NET & C# ultra low latency environments.
â–¬ Execution Quality & Microstructure Analytics
If my profile fits what your team is working on, you can connect through the proper channel.