• Jason Madden's avatar
    Use bytearray += instead of bytearray.extend · fb319150
    Jason Madden authored
    This compiles to fewer bytecodes and uses built-in slots instead of
    method dispatch, so it should be faster.
    
    Benchmarks show a tiny improvement (using the same benchmarks as
    issue #1233, so not exactly designed to test this):
    
    RPS
    
    +------+------+-------+
    |Size  |master|+=     |
    +------+------+-------+
    |1     |5.60  | 5.63  |
    +------+------+-------+
    | 10   |5.49  |  5.53 |
    +------+------+-------+
    |  100 |4.99  |   5.00|
    +------+------+-------+
    |  1000|3.53  |   3.57|
    +------+------+-------+
    fb319150
pywsgi.py 58.9 KB