This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky
Date 2008-02-27.04:42:35
SpamBayes Score 0.14607638
Marked as misclassified No
Message-id <1204087358.25.0.336185650198.issue2197@psf.upfronthosting.co.za>
In-reply-to
Content
I am attaching a proof-of-concept patch that changes the bytecode 
generated from {1:1,2:2,3:3,4:4} from 

BUILD_MAP                4  
LOAD_CONST               2 (1)  
LOAD_CONST               2 (1)  
STORE_MAP             
LOAD_CONST               1 (2)  
LOAD_CONST               1 (2)  
STORE_MAP             
LOAD_CONST               4 (3)  
LOAD_CONST               4 (3)  
STORE_MAP             
LOAD_CONST               3 (4)  
LOAD_CONST               3 (4)  
STORE_MAP             

to

LOAD_CONST               1 (4)  
LOAD_CONST               1 (4)  
LOAD_CONST               2 (3)   
LOAD_CONST               2 (3)                                                    
LOAD_CONST               3 (2)                                        
LOAD_CONST               3 (2)                                         
LOAD_CONST               4 (1)  
LOAD_CONST               4 (1)  
BUILD_MAP                4  
 
and changes BUILD_MAP to behave similarly to BUILD_(SET|LIST|TUPLE) and 
consume 2*n items from the stack.

The advantage is more compact and faster bytecode and uniform treatment 
of BUILD_* instructions.
History
Date User Action Args
2008-02-27 04:42:38belopolskysetspambayes_score: 0.146076 -> 0.14607638
recipients: + belopolsky
2008-02-27 04:42:38belopolskysetspambayes_score: 0.146076 -> 0.146076
messageid: <1204087358.25.0.336185650198.issue2197@psf.upfronthosting.co.za>
2008-02-27 04:42:37belopolskylinkissue2197 messages
2008-02-27 04:42:36belopolskycreate