[Catalyst] dbic models and startup time server

Brandon Black blblack at gmail.com
Tue Aug 22 21:20:23 CEST 2006


On 8/22/06, Josef Chladek <j.chladek at wirtschaftsblatt.at> wrote:

> to make mod_perl the same speed I put in my perl_startup.pl
> use XMLForm::Model::xxxx
> use XMLForm::Schema::xxxx

for ALL my models -> same speed.
>
> WM 0.097695 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line
> 304.


[... gets slower ...]

UserDepotExternal 0.52905 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/
> Schema.pm line 304.
>
> is the result (+/-) for the three test-scenarios.
>
> if I put 'WM' as the last to be 'newed', I get
>
> WM 0.544998 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm line
> 304.
>
> this is strange, is not it?


Yes, that's definitely strange and interesting and warrants further
investigation...

Down another avenue: I haven't tried this myself as I don't have 20
different schemas/models to load at once, and so I'm not sure if it would
break things, but you might try this hack in your mod_perl startup.pl thingy
before the app loads:

--------------------------------------
use Class::C3;
{
    no warnings 'redefine';
    local *Class::C3::reinitialize     my @schema_classes ..... /;
    $_->require for (@schema_classes);
}
Class::C3::reinitialize();
--------------------------------------

It might screw up source registrations, I'm not sure at this point.  If it
does, perhaps we can make some changes in DBIC to make this sort of hack
possible (or even make a sane patch for globally lazy C3 reinit with some
sort of sane interface).

-- Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060822/c5beedf9/attachment.htm 


More information about the Catalyst mailing list