[Catalyst] Global 'helper' methods

Tomas Doran bobtfish at bobtfish.net
Tue Oct 30 22:54:41 GMT 2012

On 30 Oct 2012, at 15:47, Hugh Barnard wrote:

> Hi 
> On measurement in general, I'd recommend: Devel::NYTProf::Apache ; there's a write up here:
> http://www.slideshare.net/bobcatfish/profiling-with-develnytprof 


Personally, I'd not be using mod_perl if I could help it, but NYTProf is awesome!

> . It looks like I've been having performance problems because millions of rows get blessed into objects, not sure of this but it looks like a DBIC thing at the moment. 

Inflating a million objects is costly.

Are you really building an HTML page with a million rows? If so, why (isn't paging a better solution?)

I.e. I'd generally say you should either paginate things, or make the query return an aggregate set of results by doing the math or whatever at the DB server.

However, if you really do need to re-inflate a lot of stuff, look at DBIx::Class::ResultClass::HashRefInflator - given you only want the raw data and none of the clever, this is much much faster :)


More information about the Catalyst mailing list