minimal python27.dll?

Martin v. Loewis martin at v.loewis.de
Wed Apr 27 22:06:36 CEST 2011


Am 27.04.2011 12:43, schrieb est:
> Hi guys,
> 
> I need to ship python runtime environment package on Windows, if I
> want to stripping unnessasery functions from python27.dll to make it
> as small as possible(and perhaps finally UPX it), which parts of
> python27.dll do you think can be removed?
> 
> From what I think, these parts are not needed when shipping with final
> end-user product:
> 
> 1. debugging
> 2. parse text .py files, because everything is already in bytecode
> 
> Any ideas? Critics?

You really should be looking at object sizes first. In your build
of Python, find out what object files are largest, and check whether
they can be removed or shrinked. Starting with functions that you know
you won't need isn't as productive, as it likely leads only to small
reductions. E.g. you'll find that there is actually no debugging
support in python27.dll anymore that is worth stripping.

OTOH, you'll also find that the CJK codecs use quite some space,
if you don't need them, they give a rather impressive reduction.
Likewise for the Unicode database, although you may actually need
it in some cases.

I'd rather go for a static build of Python, and let the linker figure
out what's needed.

Regards,
Martin



More information about the Python-list mailing list