Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Our Luxurious, Rubinesque, Python 2.4

0 views
Skip to first unread message

Larry Hastings

unread,
Mar 31, 2005, 9:03:06 PM3/31/05
to
I finally got 'round to installing Python 2.4. I'm planning on using
Python for downloadable software, where every kilobyte counts and
smaller is definitely better. Imagine my surprise when I looked up
python24.dll and found SWEET JUMPING CHRISTMAS it's ballooned up to
1.8MB!

This isn't a deal-killer outright. But python23.dll is 1.0MB, svelte
by comparison.

Can someone tell me what made it 80% larger? Also, how much would I be
able to trim away if I recompiled it myself? Is a lot of it native
implementations of Python libraries that I might not care about
including, or is it all fundamental VM stuff that couldn't possibly be
removed?

Thanks,


/larry/

Jeff Epler

unread,
Mar 31, 2005, 10:38:21 PM3/31/05
to Larry Hastings, pytho...@python.org
In my experience, when built with the same compiler (gcc 3.3.3) the size
of the python library file (libpython2.x.a on unix machines) hasn't
changed much between 2.3, 2.4, and current CVS:
-rw-r--r-- 1 jepler jepler 950426 Mar 31 21:37 libpython2.3.a
-rw-rw-r-- 1 jepler jepler 1002158 Mar 31 21:36 libpython2.4.a
-rw-rw-r-- 1 jepler jepler 1001982 Mar 31 21:36 libpython2.5.a

Between Python 2.3 and 2.4, the python.org people switched to a
different version of the Microsoft C compiler. Perhaps this is (part
of) the explanation.

Jeff

"Martin v. Löwis"

unread,
Apr 1, 2005, 12:31:20 AM4/1/05
to
Larry Hastings wrote:
> Can someone tell me what made it 80% larger?

python24.dll includes many of the extension modules that were separate
.pyd files in 2.3, namely _csv, _sre, _symtable, _winreg, datetime,
mmap, and parser, i.e. all extension modules that don't require specific
libraries. Furthermore, a few builtin modules where added to 2.4 that
were not present in 2.3 at all.

> Also, how much would I be able to trim away if
> I recompiled it myself?

Hard to tell. I think people have been able to get it down to 180k.

> Is a lot of it native
> implementations of Python libraries that I might not care about
> including, or is it all fundamental VM stuff that couldn't possibly be
> removed?

No. Most of it is modules, followed by objects. Removing modules is
easy; removing objects is more difficult: while you could make a Python
interpreter easily that does not support complex numbers, it is much
harder to build a Python interpreter that does not support weak
references.

Regards,
Martin

Kay Schluehr

unread,
Apr 1, 2005, 3:17:17 AM4/1/05
to
Larry Hastings wrote:

> Also, how much would I be
> able to trim away if I recompiled it myself? Is a lot of it native
> implementations of Python libraries that I might not care about
> including, or is it all fundamental VM stuff that couldn't possibly
be
> removed?

In Pythons config.c file You can determine which ext-modules will be
compiled into the core. I estimate that a lean core would have a size
around ~600kb. Trimming down further may become hard because You may
have to decide what to sacrifice: tuples, classes or objects ;)

Regards,
Kay

0 new messages