Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: SQL Result Cache Performance Comparison

by mp (Deacon)
on Jul 24, 2002 at 15:25 UTC ( [id://184888]=note: print w/replies, xml ) Need Help??


in reply to Re: SQL Result Cache Performance Comparison
in thread SQL Result Cache Performance Comparison

The simple memory cache from Randall's article provides data expiration. It never returns cached data older than the timeout period. With its 15x speed improvement over simple MySQL queries, it could be useful for caching simple persistent objects that require only a simple select by primary key to load. It could also be easily extended to limit memory usage (rudimentarily) by limiting the number of entries in the cache. Whether it is worthwhile in a particular application would depend on several factors (memory availability, size of elements being cached, locality of reference, expiration time limit, others?).

I agree that (at least with MySQL as the DB, accessed through Unix sockets) it would only be beneficial to use Cache::MemoryCache or *::FileCache to cache more complex queries or data that require a significant amount of perl execution time to construct. (Example: complex joins, selects that return many rows which must be iterated over to retrieve the data, or data structures that are built by combining the results of several queries). Another possible use is in a multi-server environment, where caching lets you transfer part of the work load from an overloaded database server to an less overloaded application server even without a single process performance gain.

Any ideas why there is so little performance difference between Cache::FileCache and Cache::MemoryCache in this benchmark? Is that realistic?

Replies are listed 'Best First'.
Re: Re: Re: SQL Result Cache Performance Comparison
by IlyaM (Parson) on Jul 24, 2002 at 15:44 UTC
    Any ideas why there is so little performance difference between Cache::FileCache and Cache::MemoryCache in this benchmark?

    Hmm. From your benchmark it looks like Cache::MemoryCache is two times faster than Cache::FileCache. I would not call it 'little performance difference' :)

    --
    Ilya Martynov (http://martynov.org/)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://184888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-28 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found