[Catalyst] DBIx makes Catalyst startup painfully slow

Eden Cardim edencardim at gmail.com
Tue Feb 10 19:43:09 GMT 2009


On Tue, Feb 10, 2009 at 2:08 PM, Neo [GC] <neo at gothic-chat.de> wrote:
> I'm afraid this is all I can get out of it, as I don't have any fancy
> load_classes-stuff or anything in my models, just definitions like table(),
> add_columns(), has_many(), belongs_to() aso.
> If someone knows further tweaking, please be free and post it! :)
>
> Btw: My main schema constists of 148 tables with a rather complex layout.
> Every foreign key constraint is included.
>
> I wonder what magic DBIx does in the remaining 4 seconds... In another
> project - written in PHP - I have models with similar functionality created
> by a self-written class, which is executed at every request and takes about
> 0.05 seconds on the same machine...

->load_classes is a DBIx::Class::Schema method, check the docs, if you
don't provide any arguments it uses Module::Find to scan the disk in
search of table classes, and given you have 148 tables, that's
probably what's hitting you. Just declare all your loadable classes
manually and you'll probably shave off most of load time.

-- 
   Eden Cardim       Need help with your Catalyst or DBIx::Class project?
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://edenc.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list