• Raymond Hettinger's avatar
    SF patch #670367: Micro-optimizations for ceval.c · 4bad9ba2
    Raymond Hettinger yazdı
    Make the code slightly shorter, faster, and easier to
    read.
    
    * Eliminate unused DUP_TOPX code for x==1.
    compile.c always generates DUP_TOP instead.
    
    * Since only two cases remain for DUP_TOPX, replace
    the switch-case with if-elseif.
    
    * The in-lined integer compare does a CheckExact on
    both arguments. Since the second is a little more
    likely to fail, test it first.
    
    * The switch-case for IS/IS_NOT and IN/NOT_IN can
    separate the regular and inverted cases with no
    additional work. For all four paths, saves a test and
    jump.
    4bad9ba2
ceval.c 87.9 KB