[wp-hackers] Cache solution for WPMU?

"Roland Häder" r.haeder at will-hier-weg.de
Wed Sep 20 09:18:01 GMT 2006

-------- Original-Nachricht --------
Datum: Wed, 20 Sep 2006 00:30:21 -0700
Von: Matt Mullenweg <m at mullenweg.com>
An: wp-hackers at lists.automattic.com
Betreff: Re: [wp-hackers] Cache solution for WPMU?

> No one can vouch for the collective quality of 20+ plugins.
My classmade has "interpreted" this sentence for me. You mean I have to much plugins installed and that's why my blog is slow? Is that how I have to interprete this? My English is a bit poor. :-)

Well, if you mean this I need to tell you that I'm "benchmarking" and testing WordPress a little by hacking core code, modifying templates and patching other's plugins. While this progress I have improved several plugins for other people (e.g. Ozh's Click Counter, Bot-Check, BDP RSS Aggregator and many more, Spam Karma 2). I made them all all work together.

Now I'm targeting on the core of WP. I want to improve it in many cases. Let me give you an example here:

wptexturize() is a core function. It uses a bundle of preg_replace() and str_replace() functions. When you send one text, e.g. "The lazy dog jumps over the brown fox." (or so ;-) ) it will always (!) produce the *same* result. And here my optimization comes:

When the same source text will always become the same target text why don't we cache it on disc and/or in an array? We don't need to let the interpreter do the same thing 20 times (e.g. when the script shall 20 times do wptexturize() on the same text).

I have done it here and the result is a lesser usage of preg_replace() and str_replace(). The result is a much faster execution time. :-)

> Looks like a good example of why development topics are probably better 
> for the mailing lists.
Yupp, I know. :-) I still have trouble sending signed and unencrypted emails with my mail program "KMail" to this mailing list. I can only send email here from the GMX' webmail website. Sorry for the advert on bottom of this email. :-(

> If you mean the $wpdb cache changes, I don't think this would be a good 
> candidate for core. Even when not hitting the query cache, WP's queries 
> are usually less than 5% of its total execution time unless something on 
> the DB end is really badly configured or there is an unusually high load.
In general, when no data is updated by queries like UPDATE, INSERT, DELETE, ALTER there is a good chance to cache the data because there is no need to communicate with the database which is time-consuming (PHP has to send the query to the database, the database processes the query, utilize the discs which takes time, and finally send the fetched data back to PHP).

> Far more time is spent in the compiling and execution of PHP, which is 
> why things like APC give such a huge boost in performance and something 
> like wp-cache which prevents most of WP from loading performs great.
I use the Zend extension "eaccelerator" here. :-)

> There is a built-in caching system in WP. It's not turned on by default 
> anymore because the performance boost was insignificant and it caused 
> lots of support errors. You can enable it in your wp-config.php file.
A good point for me starting development on it. Well, I have already activated it here and experienced no problems with it. Let me see what I can do.


NEU: GMX DSL Sofort-Start-Set - blitzschnell ins Internet!
Echte DSL-Flatrate ab 0,- Euro* http://www.gmx.net/de/go/dsl

More information about the wp-hackers mailing list