You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The size of Python executable files has significantly increased starting from the 20250517 build #941
I've noticed that, starting with the 20250517 build, the file size of the python executable file is significantly larger than in builds from 20250409 and earlier.
For example:
The python3.9 file from cpython-3.9.22+20250409-x86_64-unknown-linux-gnu-install_only.tar.gz is only 21KB
The python3.9 file from cpython-3.9.22+20250517-x86_64-unknown-linux-gnu-install_only.tar.gz is about 47MB
I'm wondering why the size has changed so much. Can we reduce the file size as before, because it affects the size of our Docker images?
With the change to statically linking libpython into python, the dynamic libraries are typically not needed at runtime. If you are looking to save space these can be safely removed in a majority of use cases. For example using rm lib/libpython*.
These libraries are included in the distributions for user who want to embed python, some build systems that need libpython, and a few other edge cases.
Activity
zanieb commentedon Jan 4, 2026
The change is from #592 which statically links
libpythoninto thepythonexecutable. It makes a dramatic difference in performance (10-25% faster).jjhelmus commentedon Jan 5, 2026
With the change to statically linking
libpythonintopython, the dynamic libraries are typically not needed at runtime. If you are looking to save space these can be safely removed in a majority of use cases. For example usingrm lib/libpython*.These libraries are included in the distributions for user who want to embed python, some build systems that need
libpython, and a few other edge cases.