commit | dd80f762650f42f5f9ae820d9f55b21ed6f33bc0 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Sun Mar 07 07:31:06 2004 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Sun Mar 07 07:31:06 2004 +0000 |
tree | f7e7e6545b9896601dd13a1c07e409fef88ede2b | |
parent | bff63f034366b0cf0442e9db5e5674751beca25a [diff] [blame] |
SF patch #910929: Optimize list comprehensions Add a new opcode, LIST_APPEND, and apply it to the code generation for list comprehensions. Reduces the per-loop overhead by about a third.
diff --git a/Lib/opcode.py b/Lib/opcode.py index 39d4bd2..ae9f6cc 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py
@@ -56,6 +56,7 @@ def_op('UNARY_INVERT', 15) +def_op('LIST_APPEND', 18) def_op('BINARY_POWER', 19) def_op('BINARY_MULTIPLY', 20)