Unlocking Python's Cores: Hardware Usage and Energy Implications of Removing the GIL

This study evaluates Python 3.14.2's experimental free-threaded build, revealing that while it significantly improves execution time and energy efficiency for parallelizable workloads, it incurs higher memory usage and increased energy consumption for sequential or highly contended tasks, indicating that its adoption depends on specific workload characteristics rather than offering a universal performance boost.

José Daniel Montoya Salazar

Published 2026-03-06
📖 5 min read🧠 Deep dive

Imagine Python as a busy, single-lane highway where cars (your code instructions) are trying to get to their destination.

For decades, this highway had a strict rule enforced by a Traffic Cop named "GIL" (Global Interpreter Lock). The GIL's job was to make sure that even if you had 12 lanes of road available (12 CPU cores), only one car could drive at a time. If you had 100 cars (threads) trying to move, they all had to wait in a single-file line, taking turns one by one. This kept things safe and simple, but it was incredibly slow and wasted a lot of potential road space.

Recently, the developers of Python decided to try an experiment: What if we remove the Traffic Cop? They built a new version of Python (starting with version 3.13/3.14) where the GIL is gone, allowing all 12 lanes to be used simultaneously.

This paper is like a fuel efficiency report for that new highway. The researcher, José, asked: "If we let all the cars drive at once, do we save energy (electricity), or do we just burn more fuel because the traffic gets chaotic?"

Here is what the study found, broken down into simple scenarios:

1. The "Native Extension" Cars (NumPy)

The Scenario: Imagine some cars are actually trains running on their own separate tracks (these are C/C++ libraries like NumPy). They don't need the Traffic Cop at all; they just zoom past.
The Result: Removing the Traffic Cop made zero difference. The trains were already going fast.
The Catch: The new highway system actually required a slightly larger map (more virtual memory) just to exist, but the actual driving time and fuel usage stayed the same.
Takeaway: If your app mostly uses heavy-duty math libraries, the new Python version won't make it faster or greener.

2. The "Solo Driver" (Sequential Code)

The Scenario: Imagine a single driver trying to get to work alone.
The Result: When the Traffic Cop was removed, this driver actually got slower (13% to 43% slower) and used more fuel.
Why? Without the Cop, the car had to install extra safety features (like checking every mirror constantly) to make sure it didn't crash into itself. Since there was no one else on the road to help, these extra safety checks just wasted time and gas.
Takeaway: If your code runs one thing after another, the new Python version is actually worse for you.

3. The "Team of Drivers" (Parallel Numerical Work)

The Scenario: Imagine a delivery company with 100 packages to drop off. They hire 10 drivers, and each driver has their own list of packages that nobody else touches.
The Result: This is where the magic happened! With the Traffic Cop gone, all 10 drivers could work at the same time.

  • Speed: They finished the job 4 times faster.
  • Energy: Because they finished so quickly, the total electricity used dropped by about 75%. Even though they were using more engines (cores) at once, the fact that they were done so much sooner saved massive amounts of energy.
    Takeaway: If your code can split work into independent chunks, the new Python is a superpower. It's faster and greener.

4. The "Chaotic Office" (Shared Objects)

The Scenario: Imagine a team of 10 drivers, but they all have to write on the same single whiteboard to update the status of their deliveries.
The Result: Disaster. Without the Traffic Cop, the drivers started fighting over who gets to write on the whiteboard first. They spent more time arguing and waiting for turns than actually driving.

  • Speed: They became 12 times slower than before!
  • Energy: They burned 380% more energy because they were running their engines while stuck in traffic jams caused by their own arguments.
    Takeaway: If your code has many threads fighting over the same data, the new Python version will make it a nightmare.

The Big Picture: What Does This Mean for You?

The study concludes that removing the GIL is not a magic wand that makes everything better. It's a specialized tool.

  • The Good News: If you are building high-performance data tools or AI models that can split work into independent pieces, you can save a massive amount of time and electricity.
  • The Bad News: If you are writing simple scripts or code where many parts need to talk to the same data, the new version will be slower and use more energy.
  • The Memory Cost: The new version always uses a bit more "mental space" (memory) just to keep track of all the safety checks, even when it's not helping.

The Final Analogy:
Think of the GIL as a strict but efficient manager.

  • For solo workers, the manager is annoying but necessary.
  • For teams working on separate projects, the manager is a bottleneck; removing them lets the team fly.
  • For teams working on the same project, removing the manager causes chaos and fights.

The Bottom Line: Developers shouldn't just switch to the new "No-GIL" Python because it sounds cool. They need to look at their code first. If their code is like a team of independent drivers, they should switch. If it's like a team fighting over a whiteboard, they should stay with the old version.

And here is the most important rule of thumb from the paper: If you make your code run faster, it will almost always use less energy. Speed is the key to saving power.