[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-3000
Subject:    [Python-3000] 3.0: smaller than 2.6
From:       Antoine Pitrou <solipsis () pitrou ! net>
Date:       2008-08-31 12:56:15
Message-ID: loom.20080831T121537-844 () post ! gmane ! org
[Download RAW message or body]


Hi,

Just a bunch of simple statistics between the current py3k branch and the trunk.
Compilation was done with all default values (bare "./configure") on a Linux
machine with gcc, in non-debug mode.

The fact that 3.0 is measurably smaller than 2.6 (for various meanings of the
"size" metric) is not a surprise in itself, but still interesting to verify and
quantify.

Compilation time ("time make")
------------------------------

* 2.6:
153.68user 9.06system 2:52.91elapsed 94%CPU
* 3.0:
141.31user 7.99system 2:41.93elapsed 92%CPU

Object code size ("size python")
--------------------------------

The 3.0 executable has ~70KB less object code (for a total of ~1MB object code).

* 2.6:
   text	   data	    bss	    dec	    hex	filename
1177856	 170508	  37428	1385792	 152540	python
* 3.0:
   text	   data	    bss	    dec	    hex	filename
1103421	 164000	  93584	1361005	 14c46d	python

Executable size ("strip python && ls -sk python")
-------------------------------------------------

Here is the size of the executable in kilobytes. Dependent libraries ("ldd
python") are the same for both.

* 2.6:
1328 python*
* 3.0:
1252 python*

Runtime size of the interpreter
-------------------------------

I launch the interactive interpreter and then launch a pystone run (by typing
"from test import pystone; pystone.main()" at the prompt). Launching pystone is
just an easy way of "doing something" from the command-line, to ensure that the
necessary basic stuff is loaded and initialized. At the end of the pystone run,
I run "ps aux" and note the memory consumption values.

It is not obvious to interpret these numbers, and more meaningful workloads
would probably show 3.0 taking more memory than 2.6, due to strings being
unicode by default.

* 2.6 ("./python -E"):
VSZ=6292, RSS=4328
* 3.0 ("./python -E"):
VSZ=6876, RSS=4132

* 2.6 ("./python -E -OO"):
VSZ=6240, RSS=4252
* 3.0 ("./python -E -OO"):
VSZ=6712, RSS=3948

(the numbers are collected after a second run, so there is no bytecode
compilation phase)

Number of code lines ("make distclean && sloccount .")
------------------------------------------------------

3.0 is smaller by 25% (a massive 180000 lines of code have been removed, 70000
of which in the Mac directory which has become almost empty).

* 2.6:

SLOC	Directory	SLOC-by-Language (Sorted)
294958  Lib             python=294883,sh=75
204473  Modules         ansic=190682,asm=9565,sh=3927,python=299
91268   Mac             ansic=77313,python=13090,objc=756,sh=109
56952   Objects         ansic=56952
36698   Python          ansic=36698
29763   Tools           python=29660,ansic=67,sh=36
18351   Demo            python=17987,ansic=360,sh=4
8927    PC              ansic=8320,python=607
5935    Include         ansic=5935
5782    Parser          ansic=3926,python=1856
3802    Misc            lisp=2933,python=595,sh=175,ansic=99
2729    Doc             python=1947,ansic=782
2071    RISCOS          ansic=2071
1408    top_dir         python=1239,sh=169
351     PCbuild         python=281,ansic=70
0       Grammar         (none)


Totals grouped by language (dominant language first):
ansic:       383275 (50.20%)
python:      362444 (47.47%)
asm:           9565 (1.25%)
sh:            4495 (0.59%)
lisp:          2933 (0.38%)
objc:           756 (0.10%)

* 3.0:

SLOC	Directory	SLOC-by-Language (Sorted)
241350  Lib             python=241305,sh=45
179281  Modules         ansic=165789,asm=9565,sh=3927
50523   Objects         ansic=50523
36196   Python          ansic=36196
26791   Tools           python=26688,ansic=67,sh=36
18269   Demo            python=17905,ansic=360,sh=4
8923    PC              ansic=8316,python=607
5747    Parser          ansic=3881,python=1866
5623    Include         ansic=5623
3517    Misc            lisp=2948,python=293,sh=177,ansic=99
2728    Doc             python=1946,ansic=782
2368    Mac             python=1495,objc=756,sh=109,ansic=8
1351    top_dir         python=1112,sh=239
351     PCbuild         python=281,ansic=70
0       Grammar         (none)


Totals grouped by language (dominant language first):
python:      293498 (50.34%)
ansic:       271714 (46.60%)
asm:           9565 (1.64%)
sh:            4537 (0.78%)
lisp:          2948 (0.51%)
objc:           756 (0.13%)


_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: http://mail.python.org/mailman/options/python-3000/python-3000%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic