> On Thu, Feb 27, 2003 at 10:42:19AM +0000, Jonathan Peterson said:
> > "Can this be cached so the next similar request has no computation 
> > overhead?" The wonderful or-cache (or Orcish manoeuvre) is your friend 
> > here. Instead of:
> > 
> > $result = compute($argument); # calls compute() function every time
> > 
> > use
> > 
> > $cache{$argument} ||= compute($argument);
> > $result = $cache{$argument};
> 
> 
> Doesn't Memoize do something like this?
> 
> Possibly in a more complicated way so for some cases your way may be
> better but ...
> 
> 


Hi,

        Thanks for all your suggestions .. unfortunatly last time I used
the profiler it crashed, but I'll take another look.

        It seems that there is no real gain to be made by stripping out
the signatures - I suppose if there was, perl would do an equivalent
optimization.

        I'll keep an eye out for caching opportunities in the code.

        I keep forgetting what Donald Knuth once wrote, "premature
optimization is the root of all evil." ....


NIge


-- 
Nigel Hamilton
Turbo10 Metasearch Engine

email:  [EMAIL PROTECTED]
tel:    +44 (0) 207 987 5460
fax:    +44 (0) 207 987 5468
________________________________________________________________________________
http://turbo10.com              Search Deeper. Browse Faster.


Reply via email to