WordPress Metric Comparison of 2.9.2 and 3.0

Some times I like to look at metrics. Because I am bored? Probably. Without metrics how can really compare things. In any case I wanted to see the difference in the number of queries, generation time and peak memory usage between WordPress 2.9.2 and WordPress 3.0.

One of the things that I have heard people say since the release of WordPress 3.0 is that it is noticably faster. “Is it really?”, I asked myself. No, not out loud…or was it? Generally as much as we would like to make things faster from one release to the next, it doesn’t really happen that way. There are new features added, rewrites of code, a new default theme and in the end metrics change.

So what really changed in the way of these 3 aspects of number of queries, generation time and peak memory usage?

2.9.2:

  • 18 queries
  • 0.173 seconds
  • 15.901 MB peak memory used

3.0:

Kubrick

  • 16 queries
  • 0.209 seconds
  • 18.301 MB peak memory used

Twenty Ten

  • 15 queries
  • 0.212 seconds
  • 18.32 MB peak memory used

I have provided results as well for Twenty Ten, but so that we can perform a more apples to apples comparison we will use Kubrick. We have reduced the number of queries by 2 from 2.9.2 to 3.0, but it took 0.036 seconds longer to generate the page. In addition we now consume 2.4 MB more memory to generate the output.

I used the following code, placed at the very end of footer.php of the default theme for 2.9.2 and the very bottom of footer.php in twentyten. In 2.9.2 I removed the timer_stop line that already existed in the footer.php of the default theme.

<!--
<?php echo get_num_queries(); ?> queries
<?php timer_stop(1); ?> seconds
<?php echo round(memory_get_peak_usage() / 1024 / 1024, 3); ?> MB Peak Memory Used
-->

The testing set up:

  • Ubuntu 10.04
  • Apache 2.2.14
  • PHP 5.3.2 (Only enabled modules were mysql, gd and curl)
  • MySQL 5.1.41 (With all caching disabled)
  • Fresh installs of WordPress without any enabled plugins or modifications
  • Tests performed using curl against the front page
  • Averages over 25 tests per install

Anyway, not really the most comprehensive metrics gathering test, but just something to look at. But in the end, is WordPress 3.0 any faster? With an absolute default install, no. Does it matter that 3.0 is ever so slightly slower? No. Should I be running WordPress 3.0 now? Yes!

Hopefully you find this post useful and that I didn’t waste 15 minutes of my day that I will never get back to talk about something you could care less about.

About Matt

IF YOU REALLY want to hear about it, the first thing you'll probably want to know is where I was born, and what my lousy childhood was like, and how my parents were occupied and all before they had me, and all that David Copperfield kind of crap, but I don't feel like going into it, if you want to know the truth.

In any case I am employed as a Senior Linux Systems Engineer at Rackspace in San Antonio, TX.

I spent the majority of my college years as an Astrophysics major specializing in black holes. When I got to my senior year and was studying 40 hours a week to stay on track I decided to bail and pursue an easier career.

I spend the majority of my time now contributing to WordPress, developing WordPress plugins, helping out in the WordPress IRC Channel, playing football (not American!), practicing Krav Maga, and last but not least, spending time with my Wife and Son.

This entry was posted in Code, CoolStuff, Fun, PHP, WordPress. Bookmark the permalink.

8 Responses to WordPress Metric Comparison of 2.9.2 and 3.0

  1. Mark Jaquith says:

    You just did one run each? You should do a bunch and grab the average. Also, is this using Kubrick on 3.0, or Twenty Ten? Should be the same theme for a fair comparison.

    • Matt says:

      @Mark: Yeah, I was just about to update the post, those figures were actually an average over 25 runs each. And I used the “default” theme on each version. It wasn’t necessarily meant to be an apples to apples comparison. More of a default install to default install comparison. As I mentioned it wasn’t exactly comprehensive. I could have tested with Kubrick on 3.0 and posted results between Twenty Ten and Kubrick. I’ll however leave that to the curiosity of the reader to test.

      If anyone wants to perform such tests, just post in the comments.

      • All the time the comparison is done using two different themes you are comparing more the one variable.

        For example it could just be that TwentyTen uses less queries but takes longer to render.

  2. Demetris says:

    My tests show different numbers of queries.

    For the home page with 2 widgets (Search and Categories), 2.9 + Kubrick needs 11 queries, while 3.0 + Twenty Ten (and no custom menu) needs 10 queries.

    Twenty Ten did not start very well at the queries front. See:

    http://core.trac.wordpress.org/ticket/13085

    But then some fancy functionality was removed from it and now it does well.

    Another significant improvement in queries was for custom menus, which were rather expensive at some point in the 3.0 development cycle. But little by little the number of queries for custom menus was reduced to a very acceptable number. (Thanks mostly to several tweaks by Ryan, if I remember correctly.)

    Cheers!

  3. Matt says:

    For everyones enjoyment I have updated the post to include metrics from Kubrick on 3.0 and updated the comparison to be a more apples to apples comparison but have left the Twenty Ten metrics as well.

  4. Corey says:

    Great test for WordPress speed. I’m intrigued that 3.0 is slower even with the lesser amount of queries. What tools did you use to check the speed? Did you just do browser side or were there any server side speed tests?

  5. I made very detailed benchmarks of WP 3.0 few weeks ago for admin side, and I am preparing blog side (it will be done in a day or two), and WP 3.0 is slower on the server side, but with faster execution in the browser. Also uses more resources. But, all that is expected because many things are added to WP 3.0 to improve user experience, and every next version will require more resources, and I doubt that anything can be done about it.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre>