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

Jeff Geerling:
Yes, Drupal 8 is slower than Drupal 7 - here's why
Mar 25, 2016 @ 12:05:44

Jeff Geerling has an interesting post to his site showing the results of some of his own testing around the performance of Drupal 8 versus Drupal 7...and that 8 comes out to be slower than 7. He also includes some of the things that the Drupal project is doing to help the situation.

When some people see reports of Drupal 8 being 'dramatically' slower than Drupal 7, they wonder why, and they also use this performance change as ammunition against some of the major architectural changes that were made during Drupal 8's development cycle.

First, I wanted to give some more concrete data behind why Drupal 8 is slower (specifically, what kinds of things does Drupal 8 do that make it take longer per request than Drupal 7 on an otherwise-identical system), and also why this might or might not make any difference in your choice to upgrade to Drupal 8 sooner rather than later.

He shares the results of some of his own benchmarking on a cluster (bramble) of Raspberry Pis for the requests per second on the standard setup for each version. He includes the output from an XHProf profiling run too, showing the large call stack on both sides, not just Drupal 8. He then talks about some of the Drupal 8 updates that are included to help mitigate some of these issues: architecture changes, easier caching, authenticated user handing and slow loading content management.

tagged: drupal8 drupal7 performance raspberrypi cluster testing results benchmark

Link: http://www.jeffgeerling.com/blog/2016/yes-drupal-8-slower-drupal-7-heres-why

Johannes Schlüter:
References - Still bad in PHP 7
Feb 19, 2016 @ 09:18:45

Johannes Schlüter has a post to his site that talks about references in PHP 7 and how they're "still bad" based on some of his previous findings.

I'm known for telling "Don't use references" (also as video) as those cause different problems (i.e. with foreach) and hurt performance. The reason for the performance loss is that references disable copy-on-write while most places in PHP assume copy-on-write. Meanwhile we have PHP 7. In PHP 7 the internal variable handling changed a lot among other things the reference counting moved from the zval, the container representing a variable, to the actual element. So I decided to run a little test to verify my performance assumption was still valid.

He includes his testing code that calls a function (strlen) in a loop and compares the handling against two methods, one passing by reference the other not. The results are shown in time taken to execute. He compares the results for PHP 5 and PHP 7, noting that PHP 7 is marginally better when passed by value, by-reference is still about the same.

tagged: reference php7 php5 compare value byreference byvalue test benchmark execution

Link: http://schlueters.de/blog/archives/180-References-Still-bad-in-PHP-7.html

Djordje Kovacevic:
PHP cloud hosting comparison (OpenShift vs Heroku vs Fortrabbit)
Jan 22, 2016 @ 11:54:01

In this post to his site Djordje Kovacevic shares the results of his evaluation of hosting providers in the platform-as-a-service arena for hosting PHP applications: OpenShift, Heroku and Fortrabbit.

I want PHP 5.6+, so I did some basic testing of those services to pick cheep and good solution to host my blog. OpenShift because I use it and it's free for 3 small gears, it was pretty good solution few years ago. Heroku because I used it for Ruby on Rails projects and they support multiple languages (even multiple build packs for one project)! I used FortRabbit too, so I decided to test theirs new apps.

For his testing he used a simple Laravel (v5.2) application with a handful of routes - something simple just to test out the setup and deployment processes. There is a "tl;dr" of the results but he also gets a bit more in-depth on what each service has to offer and some of the pros and cons of each. He also includes the results of some basic performance testing on the instances, linking to the raw output if you'd like to run your own metrics against it.

tagged: heroku openshift fortrabbit paas platformasaservice hosting provider comparison pro con benchmark

Link: http://djordjekovacevic.com/articles/php-cloud-hosting-comparison-(openshift-vs-heroku-vs-fortrabbit)

Symfony Finland:
Symfony Benchmarks: Symfony Proxy vs. Varnish
Jan 05, 2016 @ 13:29:51

The Symfony Finland blog site has worked up some benchmarks comparing the Symfony Proxy versus Varnish and shared the results in this new post. The Symfony Proxy is a tool built in to the framework to help with caching responses automatically. Varnish, however, is a separate tool optimized to handle the caching of the same content but outside of the application completely.

In the previous articles we have evaluated PHP performance on different runtimes (PHP 5.6, HHVM, PHP 7) as well as how it behaves when adding server resources (CPU & RAM) using eZ Platform - a CMS built on the Symfony Framework.

In production environments Symfony and eZ Platform are likely ran behind the Varnish Reverse Proxy, which we'll evaluate next by comparing it to the built in Symfony Proxy.

They once again use the eZ platform demo application as the software under test on an 8 Core machine. The results aren't overly surprising if you're familiar with Varnish at all. Software-based caching layers are helpful but when you are able to remove the processing overhead of it from an application, you're better off.

tagged: symfony benchmark symfonyproxy varnish ezplatform statistics

Link: https://www.symfony.fi/entry/symfony-benchmarks-symfony-proxy-vs-varnish

Kinsta Blog:
The Definitive PHP 7.0 & HHVM Benchmark
Dec 09, 2015 @ 09:07:44

On the Kinsta blog Mark Gavalda has shared their latest PHP 7 versus HHVM benchmarks now that the first official stable release of PHP 7 has been unleashed for public consumption. They opted for testing with a large variety of tools and software rather than simple benchmarking scripts to give a more "real world" look at the difference between the two.

To see how much of an improvement we can expect from this new PHP interpreter we put the public release version of PHP 7.0 to test and compared a couple of popular software suites’ performance using PHP 5.6.16, PHP 7.0 and HHVM 3.10.1 on a bare metal server (so virtualization doesn’t interfere with the results). Tested software includes WordPress 4.3.1, Drupal 8, Magento 2.0 CE, OctoberCMS build 309, PyroCMS v3 beta2, and Flarum v0.1.0-beta.4.

The basic tl;dr of the post is that HHVM still performs better for all of the software tested but PHP 7 is not too far off on some of them. They share the specifications of the machine (bare metal) they used for testing and get into the results for each of the seven pieces of software tested. Their results are in transactions per second and both graphed and numeric results are shown. Unfortunately, though, the Flarum software had to be kept on a "pending" list as it doesn't run on either PHP 7 or HHVM properly.

tagged: hhvm php7 benchmark popular software wordpress drupal magento octobercms pyrocms flarum

Link: https://kinsta.com/blog/the-definitive-php-7-final-version-hhvm-benchmark/

Remi Collet:
PHPUnit code coverage benchmark
Nov 09, 2015 @ 11:57:33

Remi Collet has a quick review of some of the performance results from running the Composer PHPUnit tests on PHP 5 versus PHP 7.

As already said numerous time, PHP 7 is faster than PHP 5. Since PHPUnit 4.8 you can choose between XDebug and phpdbg as driver to retrieve code coverage data, see PHPUnit 4.8: Code Coverage Support.

Here is some benchmark results. All the tests are run using PHPUnit 5.0.8, PHP 5.6.15 as SCL or PHP 7.0.0RC6 as SCL and XDebug 2.4.0beta1 (freshly released, with some additional patches) for the composer test suite.

He shows the results in execution time and memory used for PHP 5 versus PHP 7 versions, both with and without code coverage being generated. He also includes two examples of running the tests with PHP 7, once using the XDebug debugger and one using phpdbg.

tagged: remicollet phpunit composer coverage benchmark php5 php7

Link: http://blog.remirepo.net/post/2015/11/09/PHPUnit-code-coverage-benchmark

Michelangelo van Dam:
Speeding up database calls with PDO and iterators
Jul 27, 2015 @ 08:45:28

In a post to his site Michelangelo van Dam shows you how to speed up database calls with PDO and iterators in a "no framework" environment.

When you review lots of code, you often wonder why things were written the way they were. Especially when making expensive calls to a database, I still see things that could and should be improved.

When working with a framework, mostly these database calls are optimized for the developer and abstract the complex logic to improve and optimize the retrieval and usage of data. But then developers need to build something without a framework and end up using the basics of PHP in a sub-optimal way.

He points out some of the common issues with a simple approach using just PDO and simple arrays including performance issues. Instead he recommends the use of iterators that wrap a PDO connection and allow for much simpler fetching and iteration of the found results. He includes code examples for a base iterator instance and a way to extend it to get the customized results. He also includes a few benchmarks showing the difference between a foreach loop and this iterator method.

tagged: database pdo iterator foreach benchmark compare

Link: http://www.dragonbe.com/2015/07/speeding-up-database-calls-with-pdo-and.html

Lorna Mitchell:
PHP 7 Benchmarks
Jul 06, 2015 @ 12:42:55

Lorna Mitchell has posted some preliminary PHP7 benchmarks from the current alpha release (alpha2). Good news - it's fast....very fast.

If you know anything at all about PHP7, you probably know it's fast. But did you know how fast? The alpha is out and looks very robust, so I decided I would create a new set of benchmarks to include it. Graphs first, disclaimers later :)

This graph shows the time it takes for each version of PHP to perform the same task, on average, with oldest PHP on the left and moving forward in time. [..] The benchmark is the Zend/bench.php that lives in the PHP sourcecode (run ten times for each version of PHP using the php7dev VM on an average laptop, and then the mean result for each version calculated). The script runs through a series of taxing algorithms, giving a sense of how quickly a series of computational instructions can be executed.

She also talks briefly about how this can effect more real-world applications, how realistic it is to upgrade from older installs (much less painful on 5.5 or 5.6) and some things you can do to help improve PHP7 for everyone. This includes testing, working on bugs and adding extensions to this list to ensure they're made PHP7 compatible.

tagged: php7 benchmark fast realworld help testing bugfix extension

Link: http://www.lornajane.net/posts/2015/php-7-benchmarks

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

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/