[Catalyst] Caching SQL results for speed...?

Bill Crawford billcrawford1970 at gmail.com
Wed Apr 13 09:07:44 GMT 2011

On 13 April 2011 06:42, will trillich <will.trillich at serensoft.com> wrote:
> Mostly thinking out loud here... but we welcome feedback if we're off
> track...
> Okay, after some perl -D:NTYProf tester.pl with 200 iterations:
> 70% of the time is taken up in five modules:
> 1) SQL::Abstract
> 2) DBIx::Class::ResultSet
> 3) Class::Accessor::Grouped
> 4) DBIx::Class::Storage::DBI
> 5) HTML::FormHandler::Field
> ...because in 200 iterations they were called millions of times each. (The
> form requested has several select/option menus.)
> Most of the data won't change rapidly -- e.g. client lists, countries,
> employees just to populate a few popup menus -- so it seems like an
> opportunity to benefit from caching the results, and only invalidating the
> cache when a new record gets updated/deleted/added. Whole tables could be
> cached without having to return to SQL/DBIC for every form-screen.
> So we're looking for documentation on a best-of-breed approach for doing
> this in a Catalyst environment...

What might help you there is a H::FH field attribute "do_not_reload => 1".

More information about the Catalyst mailing list