A New Type of PHP:
HHVM and Hack

Jeremy Mikola
jmikola

HHVM

The Elephant in the Room

  • It’s had a role in significant projects
    • Wikipedia, Drupal, Wordpress
    • Facebook: x * 10⁵ files, y * 10⁷ LOC
  • It gets some things right
    • Developer workflow: tight feedback loop
    • State: each request is a blank slate
    • Concurrency: share nothing

Taking PHP Seriously – Keith Adams, Facebook

Lifetime of a Request

Bytecode Interpreter

Native Code JIT

Repo Authoritative

Pre-compile HHBC:  hhvm --hphp -t analyze

Benchmarking HHVM

Small Responses (7 KB)

Requests / Second
Response Time (ms)
https://blog.liip.ch/archive/2013/10/29/hhvm-and-symfony2.html

Medium Responses (80 KB)

Requests / Second
Response Time (ms)
https://blog.liip.ch/archive/2013/10/29/hhvm-and-symfony2.html

Large Responses (220 KB)

Requests / Second
Response Time (ms)
https://blog.liip.ch/archive/2013/10/29/hhvm-and-symfony2.html

Installing HHVM

Grab a Snickers…

Hack

<?hh

Wonderful World of Types

Stop (ab)Using PHP Arrays

These May Be Useful, Too

Extending HHVM

Getting the Community on Board

http://hhvm.h4cc.de/