Benchmarks. PHP-FPM + OPcache vs HipHop vs Si vs kPHP


Configuration:
  • Intel Dual Core 1.60GHz, 8Gg RAM
  • PHP-FPM (PHP 5.5.3) + OPcache
  • HipHop VM 2.4.0 (rel)
  • As a web north acted nginx/1.4.1 (Ubuntu)

    Counting million decimal of Pi

    Was equivalent code written in php and C to calculate the number Pi million mark by the formula Bailey — Borueyna — Plaffa.
  • PHP-FPM: Server:37.86687 s. Mem: 0.5 Mb
  • HHVM: Server:12.00476 s. Mem: 0.19 Mb
  • Pure C compiler gcc: 3.9662 s. (php still has room to grow :)

    Calculation of PI (100,000,000 iterations)

    As kPHP does not work type double, had to make a simpler test.
  • PHP 5.5.3: 0m17.935s
  • HHVM 0m12.918s
  • kPHP 0m2.943s
  • GCC 0m2.913s

    Assistant Game blockhead

  • PHP-FPM: Server:0.04178 s. Mem: 10.75 Mb
  • HHVM: Server:0.00742 s. Mem: 0.32 Mb

    Page static content

  • PHP-FPM: Server:0.00249 s. Mem: 0.5 Mb
  • HHVM: Server:0.00218 s. Mem: 0.17 Mb
    * Memory was measured after memory_get_peak_usage(1)

    Issues when migrating from PHP 5.5 on HHVM:

  • "Bad" krasheli memcache keys for the entire server. Had to be replaced by md5(key)
  • HipHop Warning: Unable to handle compressed values yet (memcache)
  • Parameter 1 to function(&$p1) expected to be a reference, value given
  • Appeared predefined class map. Had in his code to rename.
  • php.ini The default is not connected (You can connect the server.hdf IniFile = /etc/hhvm/php.ini), phpinfo() will plug
  • No destructor auto shutdown script
  • HipHop Warning: Out of bounds $this->value[0] == '-' , if $this->value = ''
  • HipHop Warning: Failed to write session data (user). Please verify that the current setting of session.save_path is correct ()