HipHopVM 2.2.0: slower, but more compatible

We wrote before about HipHopVM, Facebook’s high-performance PHP runtime, that can be found on Github. It is a production-ready virtual machine that delivers superior performance for PHP scripts. Recently version 2.2.0 was released and it now supports many frameworks. This is a big improvement. First we compare it with the previous version and see how it performs. We tested again on Ubuntu 12,04 (the latest LTS release).


This graph shows the average execution time (of 10 runs) on PHP 5.3.10 (with APC), HipHopVM v2.1.0 and HipHopVM v2.2.0. The Y-axis shows the amount of seconds the execution took (on average) and the numbers on the X-axis represent the following benchmark scripts:

  1. bench1.php:
  2. bench2.php:
  3. bench3.php:
  4. bench4.php:
  5. bench5.php:
  6. bench6.php:

This is the raw data:


Rewriting under HipHopVM

Symfony on Apache web server requires “mod_rewrite”. If you are running Symfony on HipHopVM you are probably looking for a “mod_rewrite” alternative. Fortunately HHVM has this feature built-in. This is how you configure the VirtualHost in the hhvm.hdf file to achieve rewriting:

VirtualHost {
    * {
        Pattern = .*
        RewriteRules {
            * {
                 pattern = ^(.*)$
                 to = index.php$1
                 qsa = true


HipHopVM is getting more and more compatible. Still it does not run all frameworks, but is seems it is getting there. It may look like it is getting slower as it is getting more compatible. When you look at benchmark 5 & 6 you can see that it still has a good performance and that is has hardly become slower. The results from benchmark 1 are a bit worrying, but since that is just a simple object instantiation, I would not value that too much.

What do you think about these numbers? Did you get different results? Please share your thoughts in the comments below.


4 thoughts on “HipHopVM 2.2.0: slower, but more compatible”

  1. There are two things that made your HHVM slow:

    1. Can you publish your benchmark script?
    Have you consider using function? global-scope code is not JITted?

    2. In server mode, HHVM will run the first N requests it sees in interpreter-only mode (i.e. with the JIT off).
    The default in an optimized build is N=11, so if you were to run the request 12 times, the 12th one would be much faster.
    You can tune this with a config option, like so: -v Eval.JitWarmupRequests=3. If you set it to 0, you’ll see the speedup immediately.

  2. @Aris: I was running hhvm as “sudo hhvm –mode server -p 8080” and then:

    http://localhost:8080/bench$i.php > /dev/null”`;

    From that I used only the last 60 measurements (warmed up).

Leave a Reply

Your email address will not be published. Required fields are marked *