Language comparisons

Mitch Chapman chapman at bioreason.com
Wed May 9 11:33:56 EDT 2001


Grant Edwards wrote:
> 
> In article <QM%J6.96455$HF.21774089 at news4.rdc1.on.home.com>, Nick Perkins wrote:
> 
> >Things can usually be done many ways in python, and it is
> >rarely obvious which will be fastest.
> 
> ...
> Is that observation generally true of higher-level languages like Python,
> Scheme, and Smalltalk -- or is there something about Python that makes it
> uniquely difficult to guess what will be the fastest?

In his essay "Worse Is Better" (and also in his book
"Patterns of Software", I think), Richard Gabriel makes
some observations about programming in Lisp vs. C.  One of
his points is that you must be very familiar with the Lisp
language environment in order to choose solutions which
perform well.  From Section 2.2.: "In Lisp it is very easy to 
write programs that perform very poorly; in C it is almost
impossible."  
See http://www.stud.ifi.uio.no/~enag/worse-is-better.html

Other messages in this thread emphasize the need for
profiling, but Gabriel's point is still important.  Even when
you know where the performance problems lie you may have
trouble addressing those problems, unless you have learned
enough about what your development tools have to offer.

This is as true for Python as for other languages.  As the
language and its libraries grow (xreadlines, zip, iterators),
so grows the number of ways of solving a problem.  Knowing
which ways yield the best performance will become more
difficult.

-- 
Mitch Chapman
Mitch.Chapman at bioreason.com



More information about the Python-list mailing list