"km" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> ya i am sorry  i tried with an empty loop first and then one which emits 
> a value as the snippet. I have tested it on my machine and now ...
>
> 1) perl (v 5.8) does the job in 0.005 seconds
> 2) but python (v 2.4.1) is horribly slow its 0.61 seconds.
> and using range() instead of xrange() in python snippet, it not better , 
> it takes 0.57 seconds. just test it urself and see.

I did.  "for x in xrange(10000000): pass" (cut and pasted, Python 2.2, 10 
million passes) takes about 1.5 second (estimated by 'one thousand and 
one...' method).  Divide by 10000 for your 1000 iteration test.

> what more do i need to accept python is slow when it comes to loops 
> concept ?

Valid comparitive data from honest and competant testers with different but 
properly functioning systems.

Terry J. Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to