How does Python compare to ?

Paul Jackson pj at sgi.com
Mon Jul 31 20:50:31 EDT 2000


On Tue, 1 Aug 2000, Thomas Wouters wrote:
> On Mon, Jul 31, 2000 at 10:36:00PM +0000, Paul Jackson wrote:
> >     In the same interval, python does some 196 milliseconds worth
> >     of stuff, including 52 open attempts, 34 stat attempts, 67
> >     sigaction calls, 12 fstat's, 20 close's, 27 brk's, ...
> 
> Okay, now try it with 'python -S'. This omits the 'site.py' import, which
> itself requires a ton of other things. When using '-S', python is
> consistently 10msec faster than perl, on my P2-something running Linux.

That helps some, but not as much as you are seeing.  I just saw
the Python time on my Irix box, between loading libc and reading
the 'print' command go from 178 msec down to 72 msec.  Not close
to the 9 or 10 msec for perl.

I still see the stat for 'python' along my $PATH, the loading
of the exceptions module, and the sigaction() calls.  And it's
still mostly cpu bound, with perhaps 33 msec spent very early
on, doing just a handful of system calls (before the search
for python along $PATH), and almost 20 msec spent digesting
the exceptions module.

The number of open and stat attempts goes down to 12 and 19,
respectively.  No change in the number of sigaction calls.
-- 
-- 
I won't rest till it's the best ...	   Software Production Engineer
Paul Jackson (pj at sgi.com; pj at usa.net) 3x1373 http://sam.engr.sgi.com/pj



More information about the Python-list mailing list