[Dbix-class] Startup speed

Matt S Trout dbix-class at trout.me.uk
Fri Aug 17 14:46:43 GMT 2007


On Fri, Aug 17, 2007 at 01:27:15PM +0100, Pedro Melo wrote:
> Hi,
> 
> I'm working on a project that has about 75  tables (when we finish I  
> expect them to be in the 120-something). Running:
> 
> time perl -MSchema -e 1
> 
> gives:
> 
> real    0m19.851s
> user    0m18.674s
> sys     0m0.195s
> 
> For production, given that restarts are not common, this is  
> acceptable. For development, this is a pain.
> 
> I'm using latest DBIC, Class::C3 and C:C3::XS.
> 
> I'm considering using bleadperl for most developments to take  
> advantage of the even greater speedups, but then I have to do a round  
> of testing with the production perl.
> 
> Apart from those, is there any secret formula to speed up the startup  
> time?

use base qw(DBIx::Class::Core);

instead of load_components'ing it.

Similarly, if you have common other components do the load_components once
in a base class and then use base it from the table classes.

Also, make load_classes explicit rather than relying on Module::Find (or get
a faster disk :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/                    http://www.shadowcat.co.uk/ 



More information about the DBIx-Class mailing list