From: ivanlan at callware.com (Ivan Van Laningham)
Date: Mon, 26 Apr 1999 21:15:42 GMT
Subject: Python too slow for real world
References: <372068E6.16A4A90@icrf.icnet.uk>
		<3720A21B.9C62DDB9@icrf.icnet.uk>
		<3720C4DB.7FCF2AE@appliedbiometrics.com>
		<3720C6EE.33CA6494@appliedbiometrics.com>
		<y0jaevznhha.fsf@vier.idi.ntnu.no>
		<glmvhemn4zx.fsf@caffeine.mitre.org>
		<37215EFB.433AFCA6@prescod.net>
		<roy-2404991257450001@mc-as01-p63.med.nyu.edu>
		<3724B2D6.B468687A@prescod.net> <roy-2604991601410001@qwerky.med.nyu.edu>
Message-ID: <3724D77E.66254D78@callware.com>
Content-Length: 2247
X-UID: 308                                                  

Pythonistas--

Roy Smith wrote:
> 
> I hope this doesn't sound as bad as I fear it might, but part of being a
> good programmer (or at least a good computer scientist) is to understand
> performance issues like this.
> 
> Regular expression theory hasn't changed a whole bunch in the last 20
> years; it's the same stuff in C, Perl, and any other language that has RE
> functionality (either built-in or through some library).  The idea of
> factoring constant operations out of loops is the same today is it was 10,
> 20, 30 years ago.
> 
> If you don't know that RE's get compilied (and that the compilation stage
> can be expensive), you don't understand the tool you're using.  If you
> don't understand that factoring the expensive constant compilation process
> out of a loop is important to make your program run fast, you aren't a
> good programmer.  No programming language can help that.
> 

Roy, you're absolutely right.  However, the person who originally posted
the question (and I'm sorry, but I've forgotten who) was speaking from a
newbie's viewpoint.  Stuff that most of us on the list take for granted
is not always obvious to someone who is new both to the language and to
the field in general.  And, things that are obvious in C or C++ or some
other language are not always obvious when moving to a new language, and
some idioms simply don't exist in some languages.  Look at the questions
posted the other day by the person who wanted to know how to do things
in Python that he had to do all the time in C++ ... it was just not
obvious to him that those were neither necessary nor desirable in
Python.

In sum, I think tips on how to optimize source code need to be part of
the introductory documentation of any language; not everyone has gone to
school and learned these things in Pascal 101, and even if they have
there are idioms that won't translate.

<if-python-were-pascal-we'd-all-be-in-trouble>-ly y'rs,
Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan at callware.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
----------------------------------------------




