---
id: 12083
lang: en
title: "Python in AI: why a language 70 times slower than C is losing ground at the edge"
published_at: "2026-07-19 05:00:00"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1055592/?utm_campaign=1055592&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/12083"
categories: ["business"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Python in AI: why a language 70 times slower than C is losing ground at the edge

> **Краткая суть (BLUF):** The AI industry, the most resource-hungry in history, does most of its computing in Python. The language is roughly 70 times slower than C and ranks 26th out of 27 in an energy-efficiency ranking of programming languages.  In on-device and edge inference, compiled languages are already pushing Python aside, with Swift leading the way.

The AI industry, the most compute-hungry in history, does most of its computing in Python, a programming language that is roughly 70 times slower than C and ranks 26th out of 27 in an energy-efficiency ranking of programming languages.

## What Python's crown costs

An author on Habr breaks down the cost of this choice along three dimensions: microseconds of compute, gigawatt-hours of data center energy, and the doubled workload of engineers who have to make up for the language's slowness with extra optimization and wrappers around faster libraries. The piece relies on numbers and links to primary sources, and it also examines fair counterarguments in Python's favor, so it doesn't simply blame the language for every problem the industry has.

## Why the industry chose Python anyway

Python's dominance in machine learning is a product of history: a huge library ecosystem grew up around the language, and in practice the "slow" part of the code almost always hands off the heavy lifting to fast C and CUDA implementations under the hood. But as workloads shift from training large models in the cloud to running them on the user's side, that architectural decision starts working against the industry.

As long as training and inference ran mostly in data centers on powerful GPU clusters, Python's overhead disappeared against the overall cost of compute. That changes when a model has to run on a smartphone, a laptop, or an embedded device with a tight power budget. There, the gap between interpreted and compiled execution becomes critical for response time and battery life, rather than just a line item in a data center energy report.

## Where Python is already losing ground

As AI model inference moves onto user devices, with on-device and edge scenarios and local inference that never calls out to the cloud, Python's position is weakening. Compiled languages are already claiming this new territory, Swift first among them, since it has an edge in execution speed and power consumption in these scenarios.

* Python is roughly 70 times slower than C
* Python ranks 26th out of 27 in an energy-efficiency ranking of programming languages
* The cost of Python's dominance is measured in microseconds, gigawatt-hours, and engineering labor
* In on-device and edge inference, compiled languages, Swift first among them, are pushing Python aside

## What this cost means for data centers

The gigawatt-hours in this comparison aren't an abstraction. Interpreted Python needs more compute cycles than compiled code for the same task, which means more electricity to power and cool the servers. The doubled engineering effort is the price of constant layering: wrapping Python code around faster C and CUDA libraries, profiling bottlenecks, and rewriting critical sections at a lower level to compensate for the language's own slowness.

## What it means

Python remains the default language for training and prototyping AI models. But as inference moves to local devices and edge scenarios, where every milliwatt and millisecond counts, its cost becomes harder to ignore, and that is exactly where compiled languages have a chance to unseat the long-time leader. This isn't about replacing Python entirely in the coming years. It's about a gradual split in use cases: the cloud and prototyping stay with Python, while edge and on-device work increasingly moves to compiled alternatives such as Swift.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1055592/?utm_campaign=1055592&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/12083
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
