Wednesday, October 21, 2009

The More Things Change...

I went to the StackOverflow DevDay in San Francisco on Monday. Lots of information, most of it useful. Mark Harrison's presentation where he "deconstructed" a Peter Norvig Python script gave me a few new pointers about Python. It also got me to thinking about list comprehensions, specifically the "why"? Performance? Possibilities for parallelization?

This morning's Google search was, therefore:

Python "List Comprehension" advantages

which turned up this:


He mentions performance (as well as parallelization):
Simple for loops implemented in python are handled by the interpreter, and are slow. List comprehensions and map() have a in-built, fast, internal C implementation which does away with the overhead of the for loop.
Good to know about, but mildly ironic in that it leads back to C code for performance. The 70's meet the 00's.

No comments: