Re: Hash Cache using Require

[prev] [thread] [next] [Date index for 2004/12/04]

From: Tom Schindl
Subject: Re: Hash Cache using Require
Date: 12:51 on 04 Dec 2004
Perrin Harkins wrote:
> On Fri, 2004-12-03 at 11:17 -0800, Bill Whillers wrote:
> 
>>Am I more or less efficient than just creating the hashes directly from 
>>hitting the database everytime the application needs it? The database is 
>>*not* under heavy load, at all.
> 
> 
> If the data is small enough, loading it into memory should work fine,
> and will be faster than loading from the database.  If you only need
> access to specific items at any given time, I'd read those individually
> from the database or use a local dbm file (try MLDBM::Sync or
> BerkeleyDB) because it will save you memory over loading the full hash
> in each process.

I'd suggest reading the data from the mysql database directly and 
keeping it in memory. You've many possibilities to check whether the 
data in the database has been modified. e.g. by setting a 
update-timestamp which you request.

Tom


        -- 
        Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Hash Cache using Require
Bill Whillers 19:17 on 03 Dec 2004

Re: Hash Cache using Require
Perrin Harkins 19:39 on 03 Dec 2004

Re: Hash Cache using Require
Tom Schindl 12:51 on 04 Dec 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52