2010-09-12, 09:30 PM
Fiel Wrote:Even in Python, I can read and decompress all files in about 10 minutes (that's every graphic in the game). The language they're using, C++, is several orders of magnitude (15 - 20x) faster than python.
In what ways is it faster, though?
Python is slower than C++ because of the overhead of having an interpreter, which is an extra layer of abstraction from the code to the machine. Python code is interpreted into Python instructions, which have to be executed by the interpreter which itself is a set of native instructions. Rather than just C++ code which is compiled into native instructions that can be directly executed.
But given that decompressing files is mainly a disk operation (i.e. slow), the overhead of calling the instructions from Python should be less compared to the cost of the actual instructions themselves. Whereas if you were doing something like calculating prime numbers, Python would be much slower because the individual arithmetic operations involved are small.

