Speed Comparison Perl Python & C
Ville Vainio
ville at spammers.com
Sun Feb 29 12:56:18 EST 2004
>>>>> "Bart" == Bart Nessux <bart_nessux at hotmail.com> writes:
Bart> fair test. I thought C would do this much faster than it
Bart> did. Any ideas?
Your program prints stuff at every iteration, so it mostly measures I/O
performance. Drop out the print, or print every 1000th item, and you
will start seeing a significant differences...
This is also a textbook example of a case where using C doesn't make
much sense performace-wise. Many seem to believe that using C/C++ also
magically speeds up I/O, and choose it over alternatives because their
network server "needs to be fast".
--
Ville Vainio http://tinyurl.com/2prnb
More information about the Python-list
mailing list