Performance of list comprehensions vs. map

Tim Peters tim.one at home.com
Thu Sep 6 01:12:55 EDT 2001


[Chris Barker]
> ...
> I've proposed similar ideas in the past, and not gotten much response. I
> imagine my ideas are full of holes, but no one has taken the time to
> point them out to me yet. I have come to the conclusion that the really
> sharp minds on this list (and the folks that might be qualified to
> actually impliment such a thing) are not really interested in something
> like this that is a perfomance only improvement. Am I right? or is the
> idea just so stupid that it's not worth commenting on?

None of the above, although I'm not sure that's good news <wink>.  We're
really not lacking for ideas, what we need is worker bees.

If you have time, here are two achievable (and ancient) ideas for
optimization that would benefit all programs:

1. Remove the need for SET_LINENO opcodes.  They're not needed for line
   numbers in tracebacks (tracebacks work fine under -O already, which
   suppresses SET_LINENO).  They're only used for line-by-line tracing
   (as, e.g., used to implement debugger breakpoints), and that's a
   very rare need.

2. Move PEP 267 ("Optimized Access to Module Namespaces") closer to
   reality.  More work than #1, but more potential gain too.

That these still haven't been done is simply evidence of how little work
gets volunteered in these areas.

everyone-has-opinions-but-opinions-aren't-executable-ly y'rs  - tim





More information about the Python-list mailing list