I started reading about HHVM and Zephir. At first I was very excited that thanks to these technologies it jumps out. But then I started asking myself a question. If it really gives you that kind of performance, as the owners of these technologies say.
Now I'm going to say how I think it looks like. Correct me if I am wrong.
PHP script Live process: Run Script β Compile β Run Script
The obvious problem here is compilation. We need to compile our Script every time it was launched.
Suppose I have Apache2 installed and I run my php Script named "test.php" with:
APC: APC is enabled and the APC option is for checking changes. It should look like this:
Run Script -> Run Script
Because it has already been compiled into our memory and is ready for use.
HHVM: Hip Hop Virtual Machine, will behave similarly to APC. The difference here is that the virtual machine, which for standard PHP with APC is Zend Engine. The way it is:
Run Script -> Run Script
Because it has already been compiled (in memory?) And is ready for use.
Marshmallow: I compiled the Script to C extension. So I donβt need to compile? (I'm not sure about that). Thus, the functions inside my PHP script are now native. So, if I write another Script named "test2.php" that will run my own functions that were in "test.php" (yes, it should be in .zep format, but at the moment it doesn't matter) . Now, using APC, I am avoiding compilation.
Run Script -> Run Script
And now I'm embarrassed. As far as you can see it is all the same now. I do not see any advantages of using Zephir and HHVM over standard APC. So I would like to hear if I am right or totally wrong?
source share