loop in python

James fphsml at gmail.com
Thu Aug 25 06:08:03 EDT 2005


I am going to be a bit blunt. Don't get offended.

>> Also the first thing any newbie to python asks me is abt "raw speed in comparison with similar languages like perl" when i advocate python to perl.

Judging by your other posts, you are a newbie yourself. You are not
really in a position to 'advocate' any language over others.

>> I agree that python emphasizes on readability which i didnt see in many of the languages, but when the application concern is speed, does it mean that python is not yet ready? even most of the googling abt python vs perl  convince me that perl is faster than python in most of the aspects.

One does not compare speed when they use Perl/Python/Ruby/Tcl. They are
all more or less in the same performance ball park.

Next don't make up your own benchmarks and jump to conclusions. Writing
good benchmarks is an art. If you need data, look at peer reviewed
benchmarks such as this one. http://shootout.alioth.debian.org/
As with all benchmarks, it is really hard to make general conclusions.

And you are simply looking at the wrong issue. Even if Python is 20
times slower than it's current implementation, it would still serve my
purposes. Do you believe that you need more speed? Tell us what is it
exactly that you are building and we will tell you what to do. Fetishes
with Speed and executable size are very common for young newbies. I
know because I had been there myself several years ago.

Python has been more than ready as far as speed goes. Real people, real
enterprises have been using Python in high load applications for quite
a while now and there is nothing really left to proove. People have
written entire application servers and databases in Python.

I taught myself atleast half a dozen ways to write native extensions
for Python, just in case. In the past 4 yrs or so that I have been
using Python as my main language, I did not need to speed up my Python
program even once with a custom extension. And I process multi giga
byte data sets. Why? Because, if your program is slow, chances really
are that your algorithm is slow, not the language. And most of the
Python modules that are available that need speed (GUIs, image
processing etc), are already written in C so that you, as a user, don't
have to worry.

Just get over your imaginary need for speed and learn to use Python for
what it is intended. Once again, post your actual application need, not
vague requirements with artificial conditions (I don't want C modules).

You said, elsewhere that you are writing a web application. People have
been using CGI, which has a terrible performace record for decades on
very slow machines compared to modern PCs. My point is, web
applications, "generally" aren't exactly the kind of applications that
have a lot of computational overhead, atleast not from the logic that
runs your site and is likely to be written in Python.




More information about the Python-list mailing list