• Victor Stinner's avatar
    Optimize deque index, insert and rotate() methods · dd407d50
    Victor Stinner authored
    Issue #29452: Use METH_FASTCALL calling convention for index(), insert() and
    rotate() methods of collections.deque to avoid the creation a temporary tuple
    to pass position arguments. Speedup on deque methods:
    
    * d.rotate(): 1.10x faster
    * d.rotate(1): 1.24x faster
    * d.insert(): 1.18x faster
    * d.index(): 1.24x faster
    dd407d50
_collectionsmodule.c 72.9 KB