WordPress On Speed Redux
Projects —
16-Dec-2004 01:22
The first release candidate of the WordPress Fast Frontend has just been released and Ludo is already working on the next one. I loaded it up on my test server to try it out: less queries, faster loading. Is it a touch slower than the alpha? Possibly, but it might just be my imagination.
Ludo gave me some grief last time so I’ll try to be more clear this time around. What I like:
- A template system that separates code and markup. With all due respect to the WordPress developers, this is a really fundamental point. WP’s index.php file is terribly ugly with php tags and function calls scattered everywhere. Many WP functions emit their own markup which makes customizing page structure a nightmare.
- Less database queries. A simple page like this one generates 13 independent queries! And that’s after the changes I’ve made to remove some of the blatantly redundant ones. If you’re running a site where the database sees heavy use or resides on another machine, each of those queries will cost you dearly.
- Less files, fewer functions. If you’ve ever delved into the WP source you know how hard it is to find something. Three levels deep and you’re still searching for that elusive call and the file it resides in.
- It’s fast. Add up the previous two plus cached templates and it shouldn’t surprise you that it’s faster.
What could be improved upon:
- Reads like a shell script. This is the source of my “really messy” complaint: opening index.php you’re dropped straight into the nitty-gritty working level code. I’d like to see a simple layer of abstraction here, something that would make the main flow of execution easier to read. As a side benefit this would also neatly package all of the useful functions for code re-use both within WP-FF and for those who want to extend the system.
- Better options configuration. All of the configuration values in WP-FF are stored in an array in config.php (as opposed to the WP database). I don’t mind editing php arrays but it’s annoying having to do it every time config.php changes when a new release comes along. The array should be in a separate file that users edit and then the main config script can include it (and set sensible defaults for missing entries).
- More flexible templates. The template files and the data associated with each are hard-coded in the php scripts. If I want some data from the footer to appear in the header, for example, I’ll need to hack index.php. And when the next release comes, I have to integrate my changes again. With a more sophisticated template system (Smarty comes to mind) you could have one master template file with all of the data and the freedom to include any sub-templates as necessary.
Otherwise, Ludo’s done a great job producing these releases in such a short time. I’m tempted to convert this site over to WP-FF and see how it goes.
Jerome, thanks for testing WPFF and writing such a nice review (oh, and for spotting a couple of bugs, I should learn not to release after a full day of coding).
I completely agree with two out of your three suggestions for improving. I was thinking about it this morning while getting to work, and I decided I will encapsulate all blog-related functions in a separate class. You should then be able to customize the provided pages almost effortlessly, and to write separate pages (eg to subscribe to a mailing list) with custom logic and a full blog layout (sidebar, etc) with a few method calls.
As for speed, it is a touch slower than the alpha, but there's an additional query (most commented on posts) and a few hundred lines of code more (to send email notifications). But the templates are not cached, so there's stil lots of room to make things faster.
As for Smarty, I don't like its philosophy since the first proposal, and I don't like to use it now. What I really like is ZPT (eg TAL/TALES/METAL), the Zope/Python templating engine. There's a port to PHP (used eg by Wikipedia), but I'm writing my own since I'd like to stay close to the Zope standard, something which PHPTAL does not.
I will release a second rc today, with the fixed bugs and comment duplication detection. :)
ludo — 16-Dec-2004 03:20A few bugs, a review, and a hosting offer from Matt
I should have learned by now never to release something after a full day of coding. The last release had a few bugs, which Jerome spotted at once. I have fixed them, and will release rc2 in a few hours. Rc2 will also include duplicates detection on com...
WordPress Fast Frontend — 16-Dec-2004 03:280.1 Release Candidate 2 I expect this to be the final candidate before 0.1, which will hopefully be a bugfix release only. Right after 0.1 I will release the next unstable release, where I will refactor following two of Jerome's suggestions.
This release fixes a few bugs...
WordPress Fast Frontend — 16-Dec-2004 07:43Refactored and Released
I have wrapped up the new, refactored version and released it as 0.99.0 alpha1. Lots of changes, expect a bit more documentation soon....
WordPress Fast Frontend — 11-Feb-2005 09:26sterday - you can download it here. I’ve been looking forward to this release since my review of the last version. I tried earlier versions on my test server, but neve [...]
vapourtrails.ca » WPFF Refactored — 13-Feb-2005 00:09