[Python-Dev] Python is faster than C

Guido van Rossum guido at python.org
Mon Apr 5 12:59:13 EDT 2004

> Essentially, I wanted to rant about the fact that some performance
> considerations are driving the language's evolution, and this is
> much harder to revert to if later the performance reasons vanish.

I have to admit that sometimes I too yearn for the days of lists and
dicts, when heapq was implemented in Python.

But iterators are here to stay, and generator expressions are coming,
so we'd better get used to them, and know how to deal with them.

And yes, we'll see lots of code using genexps "for performance" while
lists would perform just as well given the actual data set sizes.

But that's okay, since genexps are a pretty nice way of saying things
regardless of performance!  And they are rarely if ever *slower* than
lists, so we shouldn't fear their performance, but rather use whatever
gives the most readable solution.

Regarding heapq: once Psyco is part of the standard library, it's easy
enough to revive heapq.py and friends.  In the mean time, I have no
problem with providing practical performance for regular Python users.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list