Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

HHVM Blog:
Improving Arrays in Hack
Nov 03, 2015 @ 11:46:14

On the HHVM blog there's a post talking about some of the updates they've made with array handling in Hack to help make it more efficient and overcoming some of the challenges in how they're being used.

Arrays are the ubiquitous data structure in PHP, used to represent everything from lists, associated lists, sets, tuples, or even a bag of data. This flexibility itself makes it challenging for Hack to understand how an array will be used. [...] If this was the only problem with PHP arrays, then the solution would be “simple”; make the type checker smarter (something we are working on). However there are a number of other semantic details around arrays that are nearly impossible to analyze statically.

They talk about some of the issues a bit more specifically including:

  • indexing of non-existent keys
  • key coercion
  • arrays containing references

They also talk about some of the legitimate use cases for arrays over the collections Hack offers, mostly do to with the values they could contain. The post ends with links to some of the other future improvements to the array handling in Hack and a look further out and their vision of replacing PHP arrays with Hack arrays and moving collections to a runtime library.

tagged: hhvm hack array improvement problem values collections

Link: http://hhvm.com/blog/10649/improving-arrays-in-hack

HHVM Blog:
LLVM Code Generation in HHVM
Oct 29, 2015 @ 12:08:22

In this post to the HHVM blog they answer a common question they get from the development community: why don't they use LLVM for code generation when compiling down the PHP.

The primary reason has always been that while LLVM is great at optimizing C, C++, Objective-C, and other similar statically-typed languages, PHP is dynamically typed. The kinds of optimizations that provide huge performance benefits for static languages tend to be less useful in dynamic languages, or at least overshadowed by all the dynamic dispatching that’s done based on runtime types. We knew that there was probably something to be gained from using LLVM as a backend, but there were many larger opportunities go after first.

They talk about the compilation pipeline HHVM uses and shows the difference between how it works versus how LLVM would integrate into the final steps. They also talk about the work put in to explore the use of LLVM IR and what kind of changes they had to make to support it. This includes updates to PHP function call handling, generalizing vasm and updates to the LLVM tool itself (with changes to location records, smashable calls and performance tweaks among others).

tagged: hhvm llvm code generation compilation changes updates support

Link: http://hhvm.com/blog/10205/llvm-code-generation-in-hhvm

PHP Roundtable:
031: Checking in with PHP & HHVM internals
Oct 08, 2015 @ 09:05:03

The PHP Rountable podcast has posted their latest episode recorded live and looking at HHVM - Episode #31: Checking in with PHP & HHVM internals. In this episode host Sammy K Powers is joined by Julien Pauli, Sara Golemon, Bob Weinand and Nikita Popov.

We chatting with some PHP & HHVM internals folks to learn what's been going on in the world of internals.

You can watch this latest episode either through the in-page video player or directly over on YouTube. If you enjoy the show, be sure to subscribe to their feed for information about their latest episodes as they're released. They're recorded live too, so be sure to also follow them on Twitter to find out where and when the next one will be recorded.

tagged: phproundtable podcast video hhvm internals live recording hangouts

Link: https://www.phproundtable.com/episode/checking-in-with-php-and-hhvm-internals

PHPUnit 4.8: Code Coverage Support
Aug 10, 2015 @ 08:48:52

Sebastian Bergmann has posted about some updates in the latest version of the PHPUnit PHP unit testing tool (v4.8) and changes in code coverage handling.

PHPUnit 4.8 introduces a couple of small improvements. For instance, the @testWith annotation was added as "syntactic sugar" for defining data providers and the --no-coverage commandline option was added for ignoring any code coverage configuration from the configuration file.

PHP_CodeCoverage, the library used by PHPUnit to collect, process, and report code coverage information, has been updated for PHPUnit 4.8. It can now collect code coverage information on PHP 7 without the need for a third-party extension such as Xdebug. And PHP_CodeCoverage's HHVM driver has been updated to reflect changes to how HHVM provides code coverage information.

He gets into a bit more detail about the updates to both the PHP 7 handling and changes for HHVM, including how to call it for PHP 7 (phpdbg vs just the normal CLI) and how HHVM no exposes its coverage information publicly. This makes it simpler for PHPUnit to grab the data without special handling code. He also looks ahead to PHPUnit 5, scheduled for release in October 2015, and that some functionality will be deprecated when the version is changed.

tagged: phpunit codecoverage support php7 hhvm changes phpdbg public

Link: https://thephp.cc/news/2015/08/phpunit-4-8-code-coverage-support

Facebook HipHop Open Source Blog:
Under the hood: Box's HHVM migration
Jul 20, 2015 @ 11:17:58

The Facebook HipHop Open Source blog has posted a case study from Box about their migration to HHVM and some of the challenges and benefits that came along with it.

Reducing latency and increasing the capacity of our infrastructure have always been top priorities at Box. We strive to deliver the best possible user experience in the most efficient manner, and historically our choice of PHP hasn’t aligned well with these goals. I'm very happy to report that we've recently made very significant strides toward these two ideals by successfully deploying HHVM (the HipHop Virtual Machine) as the exclusive engine that serves our PHP codebase. In the rest of this post, I will detail how we use PHP, how HHVM works, the challenges we faced migrating to HHVM, and the remarkable performance wins it provides.

The post talks about how central PHP is to their overall technology stack and how, despite the work being put in, the processing of requests was starting to be a bit too much. In came the HHVM and some discussion about how it might be used there at Box. They started a yearlong effort to migrate their entire stack to HHVM especially since HHVM has almost reached parity with the PHP language itself. They talk some about the differences in design between the two and how the migration changed their deployment process. They also cover some of the other interesting things that come with a major migration including phased rollout and host-based conversion methods. Finally they share some of the statistics around the performance of the end result, including the better response times and reduced CPU graphs.

tagged: hhvm hiphop opensource blog box migration

Link: https://code.facebook.com/posts/1607907626123431/under-the-hood-box-s-hhvm-migration/

Symfony Blog:
Symfony 2.3 achieves 100% HHVM compatibility
Jul 02, 2015 @ 10:53:11

On the Symfony blog they've posted an announcement that they've achieved 100% compatibility with HHVM, the virtual machine/engine created by Facebook, in version 2.3 of the framework.

HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance for PHP applications. During these last past months, HHVM and the upcoming PHP 7 version have engaged in an epic battle to become the fastest PHP engine. At Symfony we are thrilled because this fierce competition will ultimately benefit all of us.

The post shows some of the commits that were made towards the effort including the first from Joseph Bielawski and the final push from Nicolas Grekas in pull request 15,146 correcting issues in the Debug, DependencyInjection, Filesystem, Form, HttpFoundation, Process and Routing components.

tagged: symfony hhvm compatibility onehundredpercent achievement

Link: http://symfony.com/blog/symfony-2-3-achieves-100-hhvm-compatibility

Symfony Finland:
Serving PHP on HTTP/2 with H2O and HHVM (Symfony, WordPress, Drupal...)
Jun 23, 2015 @ 11:48:27

On the Symfony Finland blog there's a new post showing you how to serve PHP over HTTP/2 with HHVM and H2O. H2O describes itself as a "new generation HTTP server providing quicker response to users when compared to older generation of web servers".

This article is not about improvements made in HTTP/2 - as there are plenty of locations for you to read up on the internals. It's a hands on article to get started using HTTP/2 today with popular tools such as Symfony, WordPress and Drupal with the HHVM PHP runtime from Facebook. You can just as well use PHP-FPM.

They start with a bit of a look at the current state of PHP and HTTP/2 on the various major web server types. H2O, while younger, natively supports HTTP/2, he does offer the caveat that "waiting won't kill you". Despite this, they go on to show you how to set up the PHP+H2O+HHVM combination complete with configuration examples and what to look for in the logs to ensure HTTP/2 functionality.

tagged: serve http2 h2o hhvm tutorial webserver configuration

Link: https://www.symfony.fi/entry/serving-php-on-http-2-with-h2o-and-hhvm-symfony-wordpress-drupal

HHVM Blog:
Lockdown Results and HHVM Performance
Jun 10, 2015 @ 09:02:59

The HHVM blog has a new post today sharing the results of their first open source lockdown. During this time they worked to improve not only HHVM itself but how well it supports other open source projects using it as a platform.

The HHVM team has concluded its first ever open source performance lockdown, and we’re very excited to share the results with you. During our two week lockdown, we’ve made strides optimizing builtin functions, dynamic properties, string concatenation, and the file cache. In addition to improving HHVM, we also looked for places in the open source frameworks where we could contribute patches that would benefit all engines. Our efforts centered around maximizing requests per second (RPS) with WordPress, Drupal 7, and MediaWiki, using our oss-performance benchmarking tool.

They share some of the benchmark improvements made by the updates during the session including performance boosts for WordPress & MediaWiki. They also talk about the community involvement during the event and updates made to their own tooling too. The post then spends some time talking about their methodology on development and testing during the lockdown and how the results compare pre- and post-lockdown. The remainder of the post looks at some more specific issues and covers a few technical notes about software used and how the results were reported.

tagged: hhvm lockdown opensource benchmark improvement wordpress drupal mediawiki results

Link: http://hhvm.com/blog/9293/lockdown-results-and-hhvm-performance

Kinsta Blog:
HHVM vs PHP 7 – The Competition Gets Closer!
May 26, 2015 @ 10:19:02

In this new post to thier blog Kinsta shares benchmark results comparing PHP 7 to HHVM, both in their own experience and some shared from other companies too.

A few years ago, engineers at Facebook went on a swashbuckling mission to rebuild the foundation of the world’s most populated social network struggling to sustain acceptable performance levels. PHP was all the rage a decade ago when Facebook was gaining steam and pursuing a global target audience.

As they put it the "competition is getting closer" and the performance gap between the two is growing smaller and smaller. They talk some about the performance improvements and new features that are being worked into PHP 7 and some speculations around a Just-In-Time engine and asynchronous programming features. Then comes the benchmarks. They provide the specifications of the machine they tested on and the results of tests runs of WordPress and Drupal (based on requests per second). The rest of the article talks about two stories from other companies using HHVM, Etsy and WikiMedia, and some of the lessons that have been learned along the way.

tagged: hhvm php7 performance benchmarks mediawiki etsy wordpress drupal

Link: https://kinsta.com/blog/hhvm-vs-php-7/

Turbocharging the Web with PHP 7 (Infographic)
May 14, 2015 @ 09:06:35

In the /r/php subreddit on the Reddit.com site there's a new post that links over to this infographic from Zend sharing some of their own benchmark results for PHP 7 (and comparing it to other versions).

We ran performance benchmarks on popular PHP apps to compare PHP 5.6, PHP 7, and HHVM 3.7.

Their benchmarks includes results for:

  • Magento (1.9)
  • Drupal
  • WordPress
  • Laravel and Zend Framework
  • SugarCRM

They also compare PHP 7 against other languages, showing the execution in seconds when generating a Mandelbrot fractal.

tagged: zend infographic performance benchmark php7 php56 hhvm

Link: http://www.reddit.com/r/PHP/comments/35vf1y/get_performance_insight_into_the_upcoming_release/