Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.erje.net!news2.arglkargh.de!news.n-ix.net!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: "Martin v. Loewis" Newsgroups: comp.lang.python Subject: Re: minimal python27.dll? Date: Wed, 27 Apr 2011 22:06:36 +0200 Organization: 1&1 Internet AG Lines: 33 Message-ID: <4DB8774C.9080400@v.loewis.de> References: NNTP-Posting-Host: port-92-206-7-170.dynamic.qsc.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: online.de 1303934796 5979 92.206.7.170 (27 Apr 2011 20:06:36 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Wed, 27 Apr 2011 20:06:36 +0000 (UTC) To: est User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110402 Icedove/3.1.9 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4160 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