docker-library / docker-library/python

Faster Python, beyond semantic interposition

Open
#575 8 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
Dockerfile
Stars
2.8k
Forks
1.1k
Avg merge
3d 1h
Merged PRs (30d)
1

Description

#501 has a useful suggestion for speeding up Python by ~20%. After that's done, it's actually possible to do better.

Host is Fedora 33. All tests were run with Python 3.9.

On host:

  • Fedora's Python gives 200K pystone/sec.
  • Conda-Forge Python gives 240K pystone/sec.

Running inside Docker 20.04 (cgroups v2 enabled):

  • fedora:33 gives 173K pystone/sec.
  • python:3.9-slim-buster, I get 169K pystone/sec.
  • ubuntu:20.04 (no shared library): 183K pystone/sec.
  • continuumio/miniconda3 with Python from Conda-Forge: 189K/sec

I am mystified why things are so much slower inside Docker. Some of this is clearly not because of the image, but the runtime. But notice the Ubuntu image is definitely faster.

With podman:

  • python:3.9-slim-buster: 204K/sec
  • continuumio/miniconda3 with Python from Conda-Forge: 230K/sec

Note that the Anaconda (default Conda) Python 3.9 does not appear faster, it's specifically whatever Conda-Forge does. I am trying to figure that out.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported pystone results with Docker and Podman across the Fedora, Ubuntu, Debian slim, and Conda-Forge images listed in the issue. Compare the Python runtime and image conditions that differ between those runs. Done means identifying a specific, reproducible cause of the performance gap and documenting an actionable improvement.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.