Wilson, Douglas on 18 Nov 2004 21:08:30 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: Another Memoize foible


 

> -----Original Message-----
> From: Eric Roode [mailto:sdn.heaps13769@zoemail.net] 
> 
> Many of you will recall when Walt gave a talk, maybe two 
> years ago, about when
> NOT to use Memoize.pm.  Walt tried to memoize a trivial...
> 
> I've found another one. :-)  I have a long-running process, 
> which does a
> ridiculous number of database queries (on the order of 200 
> million).  The

Memoize might be a good fit if you have, say, a lookup function
where you pass in a customer code and you want to look up the
customer name in the database, and you have a relatively small
number of customer records, AND you know that you have a
good customer code. If there's a chance that you'll be passing
in bad customer codes (just to see if they're good or not), then
you may be using alot of memory eventually.

In the case that it's highly likely that but not certain you have a good
code,
I don't know offhand if Memoize or Memoize::Expire has facilities to not
cache "bad" arguments, but that might be a good option.

Or I've occasionally stored entire tables in memory at the start
of a process (depending on the size of data, how long the process is,
and how static the data is).

But you've probably figured all this out for yourself by now :-)

-Doug
-
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**