[Python-Dev] speeding up list append calls (original) (raw)

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed Sep 14 19:14:39 CEST 2005


Martin v. Löwis wrote:

Neal Norwitz wrote:

This code doesn't really work in general. It assumes that any append function call is a list method, which is obviously invalid. But if a variable is known to be a list (ie, local and assigned as list (BUILDLIST) or a list comprehension), could we do something like this as a peephole optimization? Alternatively, couldn't LISTAPPEND check that this really is a list, and, if it isn't, fall back to PyObjectCallMethod?

Are there any other optimizations which solely act on the name of a method? This seems a step too far.

Reinhold

-- Mail address is perfectly valid!



More information about the Python-Dev mailing list