Is Python really slow?

Garry Hodgson garry at sage.att.com
Tue May 30 21:02:14 CEST 2000


Alexander wrote:

> I have implemented  loop in Python
> 
> for k in xrange(1,100000000):
>    pass
> 
> and the same one in  C
> for ( i = 0 ; i < 1e8; i++ ) ;
> 
> and the second one seems to be working hundreds of times faster than the
> first one
> 
> Can I do anything with that.

yes.  here's a more optimal python version:

pass

-- 
Garry Hodgson                   Every night 
garry at sage.att.com                a child is born
Software Innovation Services        is a Holy Night.
AT&T Labs                         - Sophia Lyon Fahs



More information about the Python-list mailing list