Live data from Hacker News

Refactored PHP engine makes Wordpress 20% faster

news.php.net

91–100 of 147 posts

Re: Refactored PHP engine makes Wordpress 20% faster

#91
post #24
post #21

Refactoring Wordpress will make it even faster. Look at the difference between Drupal and Wordpress. It's amazing Wordpress is still used for big sites while a ton of recourses could be saved. But great work on the PHP engine!

Agreed. I ran a benchmark against CodeIgniter on a test box recently and was suprised that a single query app performance went from around ~20k req/s with raw PHP (no framework) to around ~3k req/s with CI and thought that was bad for a framework. I didn't realize Wordpress performance was so much worse especially given its popularity. Most Wordpress sites use a caching plugin like WP Super Cache or Varnish-type setu…

You should check out the framework benchmarks. Raw php is competitive with other web dev platforms performance-wise, but the major php frameworks slow it down by an order of magnitude. I blame the PSR / on-demand class loading java-style architecture which was adopted by all the frameworks. They've copied a java architecture into a platform that doesn't have java's performance characteristics.

In my own benchmarks i've noticed all that class loading and instantiation slows things way down, even with an opcache. I find that a namespaced procedural / functional architecture performs much better, but no PHP framework works that way.

http://www.techempower.com/benchmarks/

Re: Refactored PHP engine makes Wordpress 20% faster

#92
post #63

Earlier quoted context omitted.

It's a mature, well designed and cleanly written piece of software that is very modular. It also has a great documentation and knowledgeable community around it. Other PHP frameworks lack some or most of these features: some are either very opinionated and rigid (Yii, Cake) huge and sparsely documented (Zend 2) or just old and approaching abandonment (Codeigniter, Kohana).

I'm just starting to learn PHP, and I noticed that recently there have a few new books about Laravel. So, it seems to be the "new hot thing" in PHP. To a newbie, would you recommend Symfony, or Laravel? Thanks!

Yup, Laravel is a great starter framework. Like jafaku said, it uses a lot of Symfony components under the hood so it will be familiar territory if you decide to try out Symfony one day.

Be sure to check out Jeffrey Way's Laracasts, it's a really good site offering tutorials mostly for newbies.

Re: Refactored PHP engine makes Wordpress 20% faster

#93
post #60

Earlier quoted context omitted.

> Nobody mentions how much or little the PHP community thrives. People point out how bad PHP compares against other languages. I don't actually think that faults in a language matter that much if the people using it are competent. Both Javascript and Perl come close to PHP in terms of negative traits, yet a lot of good software was written with both. The same can be said about PHP, the only difference is that people…

There are many good PHP web frameworks out there today, yes. These don't somehow erase PHP's core flaws as a language though. You can make a new project in Symfony or Laravel, sure, but you'll get that same niceness plus way more goodies if you use a popular Python or Ruby framework.

I think you need to qualify that a bit - what are "way more goodies" exactly?

Can you name something that Python can do that PHP can't?

Re: Refactored PHP engine makes Wordpress 20% faster

#94

Earlier quoted context omitted.

There are many good PHP web frameworks out there today, yes. These don't somehow erase PHP's core flaws as a language though. You can make a new project in Symfony or Laravel, sure, but you'll get that same niceness plus way more goodies if you use a popular Python or Ruby framework.

I think you need to qualify that a bit - what are "way more goodies" exactly? Can you name something that Python can do that PHP can't?

No, but I can name a lot of things that are way easier and cleaner to do in Python than in PHP.

Re: Refactored PHP engine makes Wordpress 20% faster

#95

Earlier quoted context omitted.

There are many good PHP web frameworks out there today, yes. These don't somehow erase PHP's core flaws as a language though. You can make a new project in Symfony or Laravel, sure, but you'll get that same niceness plus way more goodies if you use a popular Python or Ruby framework.

I think you need to qualify that a bit - what are "way more goodies" exactly? Can you name something that Python can do that PHP can't?

> No, but I can name a lot of things that are way easier and cleaner to do in Python than in PHP.

Please do.

Re: Refactored PHP engine makes Wordpress 20% faster

#96

Earlier quoted context omitted.

I think you need to qualify that a bit - what are "way more goodies" exactly? Can you name something that Python can do that PHP can't?

> No, but I can name a lot of things that are way easier and cleaner to do in Python than in PHP. Please do.

I can name two. First, list comprehensions. In PHP, what you might write as this:

    $image_urls = [];
    foreach ($images as $image) {
        $image_urls[] = 'illos/' . $image['url'];
    }
can just be this in Python:

    image_urls = ['illos/' + x['url'] for x in images]
And, closures in Python -- and to be fair, just about any language that isn't PHP -- close over variables in the scope they're defined automatically, without having to use PHP's strange "use ($a, $b, $c)" construct. Yes, that's a small thing, but PHP's way is a little bonkers.

Re: Refactored PHP engine makes Wordpress 20% faster

#97
post #67
post #54

Earlier quoted context omitted.

If it's my hosting (which was an eee pc btw) then why does my self-written blog load in 15ms? But yeah on shared hosting with more cpu power, wordpress performed much better.

> If it's my hosting (which was an eee pc btw) then why does my self-written blog load in 15ms? Because it hit some sweet spot that WP blew over for your host specs? Either memory, number of queries, etc?

CPU seems to be the issue, but somehow Wordpress and the like (most CMS systems) seem to hit it while all PHP code I write runs perfectly fine.

Re: Refactored PHP engine makes Wordpress 20% faster

#98
post #10

Great news. HHVM and now PHP 5.7, both with JIT - the future of PHP looks bright.

While it indeed is marked as 5.7-dev, which is because it is forked from master branch which is always marked next minor version from current release one (5.6), it is very likely that it would be next major version. The changes in this refactoring are extensive and deep, and more are probably to follow. Pretty much every extension will need to be ported. This is what major versions are for.

Re: Refactored PHP engine makes Wordpress 20% faster

#99

Love the work, but honestly by the time PHP 5.7 is ready for mainstream (with extension support mysqli, memcache, mongo), Facebook HHVM will be the defacto standard. FB has a huge head start and can throw nearly unlimited money and engineering hours at the problem. Seems like a losing battle, but perhaps I am wrong.

Not likely. HHVM is Facebook's private implementation and it would require a lot of time for it to be anywhere near wide acceptance, let alone "de facto standard".

>>> an throw nearly unlimited money and engineering hours at the problem

They can, but they won't. Because it already works for them, so the amount of resources they are willing to commit to something that no longer gives any upside to them will be limited.

>>> Seems like a losing battle, but perhaps I am wrong.

There's no battle and this is not a zero sum game. HHVM will have its market and standard PHP engine will have its market.

Re: Refactored PHP engine makes Wordpress 20% faster

#100
post #21

Refactoring Wordpress will make it even faster. Look at the difference between Drupal and Wordpress. It's amazing Wordpress is still used for big sites while a ton of recourses could be saved. But great work on the PHP engine!

Agreed - fantastic news for PHP in general.

As far as Wordpress, in my experience the number of db queries is really a bigger problem than the PHP processing. A factory-default install with no plugins runs 30 queries on every home page load. With a fancy theme and a few plugins it can be over 100 queries per page! A caching plugin is pretty much essential for any Wordpress site.

Post reply on HN