making bbPress (and WordPress) work better!

PHP NG now nearly TWICE as fast as PHP 5.6

correction: php core developers have urged that it is improper to call this version “5.7” (despite the versioning file stating so)

PHP 5.7 PHP NG is still in alpha development, however it is starting to show breathtaking performance improvements over 5.6 while maintaining virtually complete compatibility.

Dmitry Stogov has been hard at work since his first announcement in mid-January 2014 and milestone update in early-May to keep folding in more and more ideas to increase PHP speed (with significant contributions by Xinchen Hui, Nikita Popov and others).

Six months later in mid-July, their efforts are really bearing fruit and PHP 5.7 NG is about to become nearly 100% faster than PHP 5.6 when rendering the front page of a stock WordPress 3.6 installation:

PHP 5.6, 1000 renderings of WP front page = 26.756 seconds

PHP NG,  1000 renderings of WP front page = 14.810 seconds

and he is not even done yet, based on all his proposals and notes as you can follow on http://wiki.php.net/phpng

The secret to this performance increase is that nearly 60% of cpu instructions have been “retired” by more efficient code:

PHP 5.6, 100 renderings = 9,413,106,833 cpu instructions

PHP NG,  100 renderings = 3,627,440,773 cpu instructions

Because most bundled extensions are now finally working with PHP 5.7 NG, you can easily build it for yourself to play with and benchmark independently. My own tests show the performance increase to be completely genuine and breathtaking.

PHP 5.7 NG will be a tremendous advantage for servers around the world. While it is highly unlikely it will be suitable for production use this year, hopefully early 2015 will bring stable betas and maybe even release candidates.

Previously the only other option to get performance like this would have been the HipHop Virtual Machine but that is hard to configure and does not offer complete compatibility, while PHP 5.7 should be a “drop in” replacement for most 5.x versions.

24 responses

  1. Pingback: PHP 5.7 now nearly TWICE as fast as PHP 5.6 | The WordPress C(h)ronicle

  2. Calling this 5.7 is **bad**.

    First, it would *have* to be a major version by very definition of how much internally it breaks.

    Second, it’s not even accepted, so it may not make it in for the next major (weirder things have happened in the past).

    Third, please don’t “guess” at version numbers. Wait for an announcement or official vote before commiting to numbers. That’s part of the reason there’s controversy around using 6 and the next major version number.

    July 15, 2014 at 11:49 am

    • If it is not 5.7 then that was an honest mistake on my part.

      Calling it 5.7 was based off this:

      https://github.com/php/php-src/blob/phpng/main/php_version.h

      #define PHP_VERSION “5.7.0-dev”

      I was not aware they were using that as a placeholder.

      July 15, 2014 at 11:53 am

      • It’s just not updated from our master branch, which currently also says 5.7. But it doesn’t need to be. Please amend your article (and its title) to use “PHPNG”.

        July 15, 2014 at 2:55 pm

    • If they improve performance by 60% (or a big chunk at least), then i’d say its enough to get the version up by a minor (major would be 6.0)

      July 15, 2014 at 4:45 pm

    • maxellisdumbell

      major versions aren’t about breaking things internally… it’s about breaking user code. if PHP 5.7 will run PHP 5.6 code, then “by very definition” the version SHOULD be 5.7… and it is. you’re an idiot.

      July 15, 2014 at 4:51 pm

      • User code is still extensions to PHP. If the internal PHP API changes, then user extension code breaks. Therefore, major version bump.

        July 15, 2014 at 7:56 pm

  3. Considering the performance improvements one really wonders how wretched the code was from the beginning

    July 15, 2014 at 12:26 pm

    • There have been some respectable incremental gains with every new 5.x release but HHVM definitely lit a fire under Dmitry. That post from January with Nikita Popov discovering a 12% improvement from just replacing the memory manager really inspired him.

      Between HHVM vs PHPNG, we all win.

      July 15, 2014 at 12:30 pm

    • Steve

      Show us your (better) code.

      July 15, 2014 at 5:08 pm

    • Nikki

      That’s really unfair. You dont start out with a well-built software. Even if its ok’ish in the beginning, there is -always- room for improvement. Dont rack down on others for improving their skills and their code.

      July 21, 2014 at 2:43 am

  4. Karoly Negyesi

    Sigh. Is this with or without opcache? You really can’t leave that out.

    July 15, 2014 at 3:17 pm

    • Opcache is now a bundled extension since 5.5 and was on for both comparisons – notice the php.ini settings stated in the wiki.

      I was able to reproduce similar numbers in my own personal tests with opcache on for both.

      July 15, 2014 at 3:28 pm

  5. Pingback: PHP 5.7 now nearly TWICE as fast as PHP 5.6 | Blog

  6. Pingback: 次世代PHPは5.6の2倍近く高速 | MOONGIFTメモ

  7. Pingback: 【朗報】PHP NGは、PHP 5.6の2倍近く高速化 – WordPressも捗る!

  8. Pingback: RT @laracasts: PHP 5.7 may be *twice* as fast as P… | Jtsternberg Tweets

  9. Pingback: PHP speed to DOUBLE in upcoming versions - The Web Atom

  10. Pingback: PHP NG è due volte più veloce di PHP 5.6? | Edit - Il Blog di HTML.it

  11. Pingback: NG?OKやん。PHPの新バージョン「PHP 5.7 (NG)」が2015年にリリース予定

  12. James

    Yellow text on white background. Awesome.

    July 16, 2014 at 5:48 pm

    • I think maybe the stylesheet is not loading for you?
      Hard refresh. This page has a dark background.

      July 16, 2014 at 5:53 pm

  13. Why they develop 5.6, not phpng to release faster, i don’t understand.

    August 29, 2014 at 12:54 am

    • And 5.7 should be 6.0 i think

      August 29, 2014 at 12:55 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 45 other followers