[Tutor] Does anyone have any hard data on Unix resource usage under Pytho n 2.0 ?

Arthur Watts arthur.watts@gbst.com
Thu, 16 Nov 2000 11:30:10 +1000

Fellow Toilers,

	If we are to implement our 'Global Environment Management (GEM)'
system using Python, one of the questions we have to answer is 'how much
memory/CPU is this thing going to chew ?'. From past experience with Perl,
we know that every instance of a Perl process (which carries the overhead of
an interpreter) adds to the overall load on the system. This can soon bring
even a large Unix machine to its knees.

	I've started collecting some basic info from simple tools like 'ps'
and 'pmap' on Solaris and Tru64, and this is the sort of data which I
currently have -

	Note : Figures below are for 'virtual usage' (VSZ in the BSD ps
output) :

	Solaris 2.6 (total memory usage from 'pmap' command, except where
stated) :
	Perl (5.00503) - we have several processes which run almost
constantly, and ps reports that they use anywhere from 3 to 6 MB per
process. pmap reports 2.5MB for the interpreter alone. 
	Python 1.5.2 - approx 3MB for the interpreter alone
	Python 2.0 - 5.3MB for the interpreter alone

	Compaq Tru64 Unix : 'virtual memory usage' (VSZ in the BSD ps
output) :

	Perl (5.005_03) - same jobs as on the Solaris box, varying between
3MB and 7.5MB per process
	Python 1.5.2 - approx 4MB for the interpreter alone
	Python 2.0 - 7.34MB for the interpreter alone

	Freezing 'Hello.py' into a stand-alone executable produced a 1.1MB
file and reduced the memory usage from 7.34MB of virtual memory to 5.26MB.
This is still too large for a scenario where we want to fork off at least
one process for each of our users. Threading, anyone ?

	In defense of the Python 2.0 usage, this release was compiled with
static support for Tkinter : I do not believe GUI capabilities will be
required on our client sites. The above figures need a lot more examination
- using ps etc is far from conclusive - but I would be interested in any
feedback from the Python community re. their experiences with resource usage
under 2.0, particularly in cases where Python may be called upon to spawn
several hundred processes on a single Unix box. 

	The issue of benchmarking is a controversial one, whether we are
talking hardware, compilers or whatever. I realize that no development
environment can mask poor design / coding practices, and this request isn't
a Perl vs Python vs Java thing ! I don't want to get dragged into that
quagmire, but I'm more than happy to take a look at any figures that you
guys have collected using Python at the coal face.

Thanks in advance,


Arthur Watts
Systems Integrator
GBST Holdings Ltd

'Good programmers know what to use, great programmers know what to re-use' :
Old Jungle Saying