NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Memoize (Score:1)
I hope you're not fetching every bit of data from the database 387 times. You should only have to fetch each unique thing once using something like the Memoize module or some homegrown version of it. If you don't have 387 global regions, then you shouldn't have 387 instances of them.
Re:Memoize (Score:2)
I'm not using Memoize. Instead, I check the id and classname and if I already have an instance of an object, I fetch it from a cache. Because it's only a reference in the cache, all instances of the object are simultaneously updated (if more than one) and I don't typically need to worry about database synchronization issues.
In other words, my initial explanation was a bit simplistic, but it seemed easier that way :)
Re:Memoize (Score:1)
Databases are good enough at doing joins that you might find that doing all-at-once JOIN queries are faster than going after the parts individually, even if you're using a cache to avoid having to do some of the queries.
Reply to This
Parent
Re:Memoize (Score:1)
Yes, this is what I was trying to say. Just say no to editing things for gnat [perl.org], kids!