diff Include/opcode.h @ 44334:07aa19170a67 legacy-trunk

Speed-up dictionary constructor by about 10%. New opcode, STORE_MAP saves the compiler from awkward stack manipulations and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem. Old disassembly: 0 BUILD_MAP 0 3 DUP_TOP 4 LOAD_CONST 1 (1) 7 ROT_TWO 8 LOAD_CONST 2 ('x') 11 STORE_SUBSCR 12 DUP_TOP 13 LOAD_CONST 3 (2) 16 ROT_TWO 17 LOAD_CONST 4 ('y') 20 STORE_SUBSCR New disassembly: 0 BUILD_MAP 0 3 LOAD_CONST 1 (1) 6 LOAD_CONST 2 ('x') 9 STORE_MAP 10 LOAD_CONST 3 (2) 13 LOAD_CONST 4 ('y') 16 STORE_MAP
author Raymond Hettinger <python@rcn.com>
date Tue, 18 Dec 2007 18:26:18 +0000
parents 09bf35793bcd
children 94e79d78dff0
line wrap: on
line diff
--- a/Include/opcode.h	Tue Dec 18 09:12:10 2007 +0000
+++ b/Include/opcode.h	Tue Dec 18 18:26:18 2007 +0000
@@ -45,6 +45,7 @@
 #define DELETE_SLICE	50
 /* Also uses 51-53 */
 
+#define STORE_MAP	54
 #define INPLACE_ADD	55
 #define INPLACE_SUBTRACT	56
 #define INPLACE_MULTIPLY	57