Hacker News new | ask | show | jobs
by ohwp 4420 days ago
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!

5 comments

I don't think it's fair to say that Drupal is faster than Wordpress by just looking at the req/sec.

According to https://wiki.php.net/phpng, they benchmarked against Wordpress 3.6 (the current version is 3.9). I couldn't find anything about the Drupal benchmark, but it could be a simple "Hello world" for all we know.

Drupal is pretty slow if you disable the default caching, and sometimes even with the caching (depends on modules loaded) - part of the problem is Drupal's table bloat. I swear a naked install has 100+ tables (and with a few plugins and a few fields enabled, has 250+ tables - so you end up with tens and hundreds of queries per page load).
Varnish fixes everything.

Drupal's big two issues are bootstrapping drupal, because all those module hooks stack up quick, and the sometimes large amount of queries run to generate a page. Drupal 8 has gotten better about not loading half of the world when a blog post is loaded, but 7 is just a wall of functions.

You seem to be mistakenly thinking that more tables by definition always == more queries. That isn't the case. A bunch of those tables rarely get queried.

I really don't understand people's aversion to database tables. I have a join, the world is ending! Pay attention to your indexes and 9 times out of 10 everything will be fine. For that 1 other time, there's Varnish.

Performance hasn't been a priority for WP in the last several releases. WP 3.3 gave a very nice bump, but no much since then.
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.

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 setup if they get decent traffic though.

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/

CI is a badly designed and outdated framework. For real speed you should use something more professional like Symfony2.
I won't disagree with you that CI is outdated, but it was originally created to work around the limitations of PHP4 and early versions of 5.x. Looking back in hindsight, it may seem "badly designed", but that would be taking it out of context.

Also, CI out performs Symfony in the web framework benchmarks: http://www.techempower.com/benchmarks/. I certainly would never equate Symfony to "real speed".

You really think those guys know how to configure for production a hundred frameworks? If you base your decisions on those benchmarks, you are gonna have a bad time.
I'm sure their benchmarks are more than adequate. In either case, if your barometer for what makes a good PHP framework is based on performance, you certainly wouldn't be choosing Symfony. If anything you'd go for for HHVM or Phalcon.
That makes no sense whatsoever. Symfony2 is fast as hell. If you don't think so, you simply don't know how to properly configure it for production. There isn't much real speed you can gain from using weird things like Phalcon, unless you don't know the first thing about caching. In fact, not having all the caching mechanisms that Symfony2 gives you will probably slow down your application, even if your code is written in C.
Depends on the WP plugins, I suppose (and Indexes created, and MySQL tuning, etc)
And themes. It's not unusual to see themes that cause 100+ database queries. Per pageview.
Lots of these themes include 3 menus. And Wordpress menus are notoriously query heavy. That's why a lot of sites have caching—not because the page is large, but because the menus take so long to load.
The speed of wordpress does not matter in the slightest.
Not sure what this has to do with the topic at hand, but since you derailed the conversation let me tell you that I run several WordPress sites with a few dozen million visits a month without much trouble.