PHP on it forgets to compile right on time, as soon as this is done with this file. This means that PHP must recompile the file every time it wants something from it. The OpCode cache (for example, you talk about it, and keep the PHP classes compiled in memory for a predetermined time).
Python, on the other hand, initially compiles things with much faster interpreted code on first run. You see all the .pyc files around your project, they are equivalent to PHP OpCode.
PHP OpCode cache is often combined into other functions (data storage with resident memory), and they are also provided in Python.
However, there are several βacceleratorsβ for Python. Most noteworthy is Psyco , which claims that under ideal conditions speed improves from 2x to 100x. But this is due to the huge cost of RAM and works only on i386 arches.
source share