Python 2 times slower than Perl

Greg Jorgensen gregj at pdxperts.com
Fri Jul 20 04:11:06 EDT 2001


"Patrick W." <anapraxis at yahoo.com.au> wrote

[long, interesting reply omitted]

Patrick, I appreciate your thoughtful reply. I think we agree on the big
picture. Personally I would be happy programming in C, Scheme, and Python as
you suggest, but the real world is a lot messier. There's lots of legacy
code written in COBOL, Fortran, PL/I, what have you. And there's lots of
code that is written in languages that seem less than ideal choices to us
Python-enlightened: Visual Basic, C++, and Java (give it ten years).

I'd add SQL (or something like it) to your list. Not for writing entire
programs, of course, but when dealing with relational sets you want a
language designed for that. That's not to say that relational databases are
the only way to organize data, but they are an efficient way to organize
some kinds of data, and more important lots of valuable data is already
stored in relational databases. When junior programmers ask me what language
they should learn to maintain their marketability, I always recommend SQL.

Benchmarks are good for measuring and improving the implementation of a
language, but they really don't say much about the language itself, or how
it compares to other languages. A language can't really be said to be slower
than another language; benchmarks only test implementations. Some languages
are by design difficult or impossible to implement as efficiently as, say,
C, but comparing those languages to C is comparing apples to oranges, like
comparing a Toyota Camry to a semi truck.

Python's clear syntax, rich built-in data types, and excellent standard
library appealed to me right off when I read Guido's tutorial. A few hours
of experimenting proved to me that I could easily write useful Python
programs, and that those programs excecuted acceptably fast enough for most
of my purposes (and I'm one of those C programmers who thinks in C). Python
was already mature when I discovered it. After ten years of work by some
clearly very talented people I'd be very surprised if huge performance
problems were lurking undiscovered in the code. I don't need benchmarks to
tell me that: the size and sophistication of the Python community, and my
own experience with the language, are enough. When newbies post their
"benchmarks" in comp.lang.python I cringe because they are blind to the most
important things about Python.

Ironically, my regular job has me writing a large web-based application
entirely in PL/SQL, Oracle's "procedural extensions" to SQL. PL/SQL was
chosen through a wrong-headed but typical corporate decision-making process.
The code I am writing is already legacy code, and it isn't even
fully-deployed yet. I've been able to use Python to help me preprocess mixed
HTML + PL/SQL code, but Python is not on the list of approved "production
languages," nor is it likely to be, because it doesn't add to anyone's job
security or political power. Fortunately I'm a contractor so the project
will someday be a memory and resume-enhancer for me, and a maintenance
headache for someone else. This is, in my experience, a fairly typical
situation in the "real world" my fellow programmers frequently refer to.

Regards,

Greg Jorgensen
PDXperts LLC
Portland, Oregon, USA






More information about the Python-list mailing list