HipHop deployment

HipHop VM is a virtual machine for PHP, with an associated just-in-time compiler (JIT).

This page is about Wikimedia-sponsored work on HipHop support in MediaWiki, and its deployment to Wikimedia production wikis.

Rationale
It is a well-studied phenomenon that even small delays in response time (e.g half of a second) can result in sharp declines in web user retention. As a result, popular websites such as Google and Facebook invest heavily in site performance initiatives, and partially as a result, remain popular. Formerly popular sites (such as Friendster) suffered due to lack of attention to these issues. Wikipedia and its sister projects must remain usable and responsive in order for the movement to sustain its mission.

While efforts such as our work on incorporating Lua have improved matters, there are many pages that still take many seconds to render. Article rendering is possibly an extreme example, but we have several other pockets of our systems that have similar problems.

Part of the problem is with the language that MediaWiki is primarily written in (PHP), which has only seen incremental improvements to performance over the past few years, despite other similar languages (particularly Javascript) witnessing vast leaps in performance. Facebook, as a big user of PHP, has recognized this problem, and invested heavily in a solution: HHVM, a virtual machine that compiles PHP bytecode to native instructions at runtime, the same strategy used by Java and C# to achieve their speed advantages. We're quite confident that this will result in big performance improvements on our sites as well.

Facebook has also invested in testing compatibility of HHVM with the standard PHP interpreter by working toward unit test parity on 21 PHP projects, including MediaWiki. We would like to add to the momentum they are currently generating, and finish a migration to HHVM now.

Roadmap
WMF's MediaWiki Core team plans to work on this area in early 2014. See Wikimedia MediaWiki Core Team/Quarterly review, January 2014 for more about the team's plans.

Additional documents

 * Status updates

To do
These tasks are available for anyone to work on:


 * Output compression is broken for large pages. Binary garbage is displayed. Isolate and report upstream.
 * Preview is broken, the server aborts when $wgParser->parse is called from EditPage::getPreviewText. Isolate and report upstream.
 * Make the PHPUnit tests work.
 * Test all core special pages and other core features.
 * Fix any extensions that you are interested in.
 * Fix the notices and warnings that HipHop generates at runtime, as far as possible.
 * Benchmarking & profiling:
 * Benchmark the CPU usage of various kinds of requests, comparing HipHop with Zend.
 * Profile CPU usage in HipHop and identify targets for optimisation.
 * Maybe look at using xhprof
 * See also the tracking bug (40926)

Further links

 * meeting notes from May 2013