469,353 Members | 2,066 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

Our Luxurious, Rubinesque, Python 2.4

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/

Jul 18 '05 #1
3 1059
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-----

Jul 18 '05 #2
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
Jul 18 '05 #3
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

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.