Turns out that pypy is 2x faster than the standard cPython, at least for sc2reader parsing:
For parsing 50 random replays, standard cPython took 10.537s, and pypy took 4.201s.
Nice speedup just for installing an alternate Python!
I was hoping to find some things in the code I could optimize, but so far the hot spots in the code look pretty solid already.
For what it's worth, here are the cProfile results showing the functions that take the most time, running in pypy:
75011558 function calls (74856283 primitive calls) in 29.720 secondsncalls tottime percall cumtime percall filename:lineno(function)
1450587 3.431 0.000 5.098 0.000 utils.py:347(read)
6206333 2.428 0.000 5.477 0.000 utils.py:145(read_byte)
10700203 2.246 0.000 2.246 0.000 {method 'read' of 'cStringIO.StringI' objects}
1300 2.223 0.002 2.223 0.002 {method 'read' of 'file' objects}
5860557 1.424 0.000 1.424 0.000 {method 'append' of 'list' objects}
So about 10% of the running time is spent in the read() function in utils.py.
~Graylin
Zsol