WP queries analyzed

ludo, Friday 03 June 2005 23:20:29 PST

After the WP/MySQL discussion of a couple of days ago, I have taken a few minutes today to set up a test envornment with WP and Lightpress, configured with the same exact features and running against the same DB taken from a 1k posts production site.

I have then logged all queries sent to MySQL (

mysqld_safe --log /tmp/my.log

) by the index page of the two frontends, and written a quick script to benchmark each statement after having primed it a few times to make sure table data is in memory. The results are pretty much what I expected (citing from memory as I don't have the test environment on my laptop): WP runs 16 or 17 queries against LP's 7 queries, and LP is faster by an order of magnitude.

I hope to be able to post a detailed analysis soon, and maybe a few suggestions on how to improve WP queries without changing their nature, as I have no patience to delve into WP's code, and I would end up with something very similar to what LP is already doing.

Readers' Comments

  1. Jeff Minard

    Erm, no contact form/email round here soooo…

    The "Read more …" links on the front page of this site are linking to the article right above it. Slightly confusing…actually, incredibly confusing ;)

    Second, on all the "pages" (about, etc) what in the world does "WPFF" stand for? My guess is WordPressFastFrontend — an old project title?

  2. jerome

    Thanks Jeff, that is most definitely a bug! Those worked fine earlier, today, probably something in 1.0.6b.

    WPFF does indeed stand for "WordPress Fast Frontend", the old (and rather unwieldy) name of this project. There are still a number of places that need to be converted to the new name, so please bear with us.

  3. ludo

    My fault, I seem to have reintroduced a bug we fixed a while ago…thanks for pointing it out.

    Jerome has not done his usual bug-spotting/fixing round on the beta. :)

  4. ludo

    The bug is fixed in 1.0.6, will announce it shortly.

  5. jerome

    I guess I have an eye for your style of bugs! :)
    plus I'm pretty meticulous about diff-ing each release (or incremental change in CVS). But I don't think I've even formally reviewed 1.0.5 yet…

  6. ludo

    I'm going to stop putting out new buggy releases :)

    I have added the devteam@lightpress-dot-org address, aliased to both our email addresses. Tell me if it works, or if you have a better name for it.

  7. jerome

    bugmakers-at-lightpress-dot-org? Just thinking out loud. ;)