Speed: bytecode vz C API calls

Aahz aahz at pythoncraft.com
Wed Dec 10 11:56:48 EST 2003


In article <tyfu148y6ye.fsf at pcepsft001.cern.ch>,
Jacek Generowicz  <jacek.generowicz at cern.ch> wrote:
>aahz at pythoncraft.com (Aahz) writes:
>>
>> Generally speaking, map() won't be any faster than a for loop.
>
>This is at odds with my own experience (including a lot of timing runs
>in the last two days), countless posts on this newsgroup over the
>years, and, for exapmle, this article
>
>  http://www.python.org/doc/essays/list2str.html

All right, what I should have said is that map() isn't enough faster
than a for loop in the cases where it is faster to make much difference,
and there are definitely cases where it's slower than the equivalent for
loop, and it's usually less readable than some other way of getting
speed.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.




More information about the Python-list mailing list