Issue 977074: speed up md5: allow Encode and Decode to inline (original) (raw)
gcc will only inline functions if they are defined before where they are used. So this patch just moves Encode and Decode up to the top of the file.
This can provide a couple percent improvement in speed. (try timeit.py -s 'import md5; m=md5.new(); d="a"*64' 'm.update(d);m.digest()' and timeit.py -s 'import md5; m=md5.new(); d="a"*0x100000' 'm.update(d)' )
Decode is only used once, so allowing it to inline actually reduces the code size, Encode is used twice but its a pretty small function so it doesn't change the size much either way..