[wp-hackers] Use of ENGINE=MEMORY w/ dbDelta() possible?

Mahmoud Al-Qudsi computerguru at neosmart.net
Mon Mar 24 21:15:05 GMT 2008

> But I wonder if it is just that tiny little bit more efficient than
> not caching at all? Is it an entirely negligible improvement?

No. It's not that it's a neglible improvement, it's that it causes a DRASTIC SLOWDOWN as a result of the MySQL overhead compared to not using object caching at all. And file-caching is therefore even faster.

Robert Marsh sent me his code (very similar to the one I posted to the list earlier), and he notes:

>If it's any use to you I've attached a version of the persistent 
>MySQL object cache. Under 2.3 it actually produced a general 
>improvement in performance on my blog, but under 2.5, with all 
>the extra caching, it degrades performance.

Same experience that I had. Basically, with a MySQL cache, the MORE you cache the LESS benefit you get.
If WP was only caching the stuff that it knows to be very heavy and then recalling that from the cache, then, yeah, it would be a performance improvement. But that's a non-ideal way of dealing with the object-cache; and it's thankfully not how WP does it.

Fact is, the overhead of a MySQL-based caching-lookup exceeds the time it would take to re-create that object from scratch. IMHO, it's a dead end and not worth pursuing further. 

I'd suggest spending one's time further optimizing the base WP code, or even re-writing the file-based cache to store all data in a single file, keep the filestream open throughout the request, and non-sequentially access the cached objects in it (if you really want a hard project that would reap some benefits that is).

More information about the wp-hackers mailing list