Is Python really slow?

Kiyo Kelvin Lee kiyolee*remove* at ctimail.com
Mon May 29 02:01:13 CEST 2000


If you want fast for this kind of do-nothing loop, why not simply remove the
loop.
If you want somekind of delay, why not using those time-delay functions.
Reminded that Python is interpreted language and C is compiled language.
Actually, some smart C compiler will remove this kind of do-nothing loop
during optimization.
Kiyo

"Alexander" <alecdem at mit.edu> wrote in message
news:392F8286.13371C4E at mit.edu...
> Hi
>
> 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.
>
> Thank you
>
>





More information about the Python-list mailing list