Enums and Python

William Dandreta wjdandreta at worldnet.att.net
Wed Jun 21 12:16:34 EDT 2000


Hi Dan,

While it is true that I first learned C++ and more recently I have been
using Delphi, I am not concerned about how the computer lays out data in
memory but I am concerned about overhead.

I have already had one experience with a Python program taking 90 minutes to
process an 18 MB file. By making what I consider minor changes in the
program, it now takes 6 minutes.

I've come to the conclusion that Python is not an inherently slow language
but it is very easy to add overhead that makes Python programs run extremely
slowly. It is much more difficult to do that in the other languages that I
use. So for the present, I am being overly cautious about adding overhead.
As I become more familiar with Python, I'm sure that will dissippate.

Also, for the simple comma delimited ASCII files that I have been
manipulated, using 10 to 15 line Python scripts, creating objects seems like
over kill to me.

Bill

>I think it's exactly the opposite.  If you want to look things up by a
>name rather than a number, look them up by a name, not by a fake name
>that actually maps to a number.  Trying to shoehorn your 'Date, Foo,
>Bar' fields into an array is the contrivance.
>
>Perhaps you come from a background in languages like C?  Often it
>takes a while to get used to writing code the way you think, without
>worrying too much about overhead and exactly how the computer is
>laying out your data in memory.
>
>--
>                 Dan Schmidt | http://www.dfan.org
>Honest Bob CD now available! | http://www.dfan.org/honestbob/cd.html





More information about the Python-list mailing list