3 ms·
Well, every instruction in a Python program requires running through the interpreter loop. Then you have to decode, get the opcode arguments, then actually do t
by pbiggar 17y ago
Well, every instruction in a Python program requires running through the interpreter loop. Then you have to decode, get the opcode arguments, then actually do the operation. For calling C functions from Python, you also have to extract the C types, call the C function, and wrap the result back up. Its not hugely slow, but yeah, it adds up, and its fairly easy to see why it compares poorly to compiled versions.