views:

48

answers:

1

I recently plugged memcaching into my PHP web software. I have a class, Cache, that manages storing things in my memcache pool. In that class, I also maintain an member array--a "threadcache"--that stores up to 100 of the most-used items.

My question is, is threadcaching going to be faster than memcaching? I would think so, coming from the argument that a memcache request potentially goes through my local network, to another computer's RAM, back through the network, and back to the requesting computer's RAM. Whereas, with threadcaching, everything would happen locally on the server running the PHP request.

+1  A: 

Unless the local cache class is very poorly designed and doesn't handle concurrency very well, it will be much faster. All other things being equal, retrieving data from local memory is always going to be faster than from another system's memory.

Rex M
Agree. Just making sure I understand Memcache correctly and am not missing anything about thread caching.
Chad Johnson