A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/042933.html below:

[Python-Dev] New opcode to simplifiy/speedup list comprehensions

[Python-Dev] New opcode to simplifiy/speedup list comprehensions [Python-Dev] New opcode to simplifiy/speedup list comprehensionsBrett C. bac at OCF.Berkeley.EDU
Sat Mar 6 15:47:53 EST 2004
Raymond Hettinger wrote:

> If there are no objections, I would like to add an opcode for calling
> PyList_Append().  This simplifies the generated code for list
> comprehensions and reduces the overhead on each pass, improving the
> timings by about 35% on [i for i in itertools.repeat(None, 500)].
> 
> The patch is amazingly brief and clear:
> 	www.python.org/sf/910929
> 

Ah, nuts!  That was going to be part of my thesis!  =)  I was going to 
along the lines of "Type-specific Opcodes for Python Based on Static 
Type Inferencing of Local Variables".  At this rate the the first four 
words won't be needed.  =)

Joking aside, I am +1 since I was planning on adding that myself as long 
as my thesis pans out and actually is a gain.

Oh, and beware the evil cache monkey and his notorious way of making the 
eval loop not fit in the CPU cache when a single thing is added to it 
(or at least I remember a comment along those lines last time people 
tried fiddling with the eval loop).

-Brett

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4