Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

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

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.

AI-processed from Habr AI; edited by Hamidun News
Python in AI: why a language 70 times slower than C is losing ground at the edge
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Python is roughly 70 times slower than C
Key metric #2Python ranks 26th out of 27 in an energy-efficiency ranking of programming languages
Key metric #3The cost of Python's dominance is measured in microseconds, gigawatt-hours, and engineering labor

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.

Story

Key Questions Answered

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.

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.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Private AI Builders Community · Vibe Club

Ship AI Faster with Founders, Engineers & Weekly Architecture Reviews

Inside Vibe Club (hamidun.com/club) — weekly live masterminds with Zhemal Khamidun, Tech Radar, full LMS access, and 370+ production Claude Code skills.

Join Vibe Club →Free intensive — waitlist
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — Python in AI: why a language 70 times slower than C is losing ground at the edge https://news.hamidun.com/en/news/12083/python-in-ai-why-a-language-70-times-slower-than-c-is-losing

What do you think?
Loading comments…