Our Luxurious, Rubinesque, Python 2.4

L

Larry Hastings

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/
 
J

Jeff Epler

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCTMItJd01MZaTXX0RAsF/AJwKOheRJfPvGyQvzo2dbvRUpk1BewCdE97I
ZAF4PJDc7wtBXWctTaLF7Ns=
=6leN
-----END PGP SIGNATURE-----
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Larry said:
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
 
K

Kay Schluehr

Larry said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

PyQt on Python 2.4 1

Members online

Forum statistics

Threads
474,232
Messages
2,571,168
Members
47,803
Latest member
ShaunaSode

Latest Threads

Top