I’m a newbie to web technology, and still on a learning curve.
Heard that, fastcgi would keep the compiled(interpreted) php code in memory, so why would one has to use op-code caching (apc or eaccelerators) for PHP?
But I never heard of any such accelerators for Python. I’d expect as python and php are both interpreted language, it makes me think that, there has to be a room for python accelerators ? pls correct me if I’m wrong.
Many thanks
PHP on its forgets a just-in-time compilation as soon as it has done with that file. This means PHP has to recompile the file every time it wants something from it. An OpCode cache (like you’re talking about side-steps this and keeps PHP classes compiled in memory for a predetermined time).
Python on the other hand natively compiles things down a much faster interpretable code on their first run. You see all the
.pycfiles around your project, they’re equivalent to PHP’s OpCode.PHP OpCode caches often bundle in other features (memory-resident data stores) and these are also provided out-the-box by Python.
There are a couple of “accelerators” for Python though. The most notable is Psyco that claims a “2x to 100x” speed improvement in ideal conditions. But this comes at a monstrously heavy cost of RAM and it only runs on i386 archs.