<< Honestly, you really ought not to care.  >>

The reason I care is that when you're using a large number of cached queries of 
differing (sometimes variable) sizes in a large, highly loaded, dynamic 
environment, it's not at all easy to know how many queries you ought to cache, 
nor what sort of durations you should place on each one.   It would be quite 
insightful to know what the average size of a cached query over a period of 
time in the cache was, to better tune the "number of queries" option based on 
the amount of memory you're willing to dedicate to that task.

As far as the question of performance, it is very important to understand the 
strengths and weaknesses of CF and Java's data types and caching mechanisms 
precisely so you can better choose between using one of them or rolling your 
own.  Anyone truly interested in high performance and optimization "ought to 
care".  

Regards,
Terry 


> Honestly, you really ought not to care.  I'd say it's safe to assume
> that MM made it operate as quickly and efficiently as possible.  If
> the functionality the built-in cache uses is sufficient for your
> needs, it's very likely it'll be faster than anything you can build 
> in
> CFML (simply because the built-in stuff is written directly in Java). 
> 
> If the functionality isn't sufficient, then you have to write your
> own.
> 
> CF provides no means to check the sizes of in-memory objects (and I
> don't thinkg Java does either - except perhaps via JVM monitoring
> tools), so it's pretty unlikely that you'll be able to do that either
> way.
> 
> Since queries are cached based on exact SQL matching, I'd consider it
> a safe wager that the cache does something like this:
> 
> function runCachedQuery(sql) {
  
> var key = hash(sql);
  
> if (! queryCache.has(key)) {
    
> queryCache.put(key, runQuery(sql));
  
> }
  
> return queryCache.get(key);
> }
> 
> cheers,
> barneyb
> 
> On 12/7/05, Terry Ford <[EMAIL PROTECTED]> wrote:
> > Has anyone found a way to get access to the underlying java 
> object(s) that CFMX uses for query caching?
> >
> > It would be nice to be able to see precisely (a) how many queries 
> have been cached and (b) how much memory each one is using at any 
> point in time.  Additionally, it would be nice to know precisely how 
> the access times for a query scales as the number of cached queries 
> increase (a hash?), and how those access times compare to self-caching 
> in arrays or structs.
> >
> > Regards,
> > Terry
> >
> > 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226519
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to