[Catalyst] dbic models and startup time server

Josef Chladek j.chladek at wirtschaftsblatt.at
Tue Aug 22 20:51:52 CEST 2006


Am 22.08.2006 um 17:29 schrieb Brandon Black:

> Is this timed under mod_perl, or standalone?  If you're timing it  
> under mod_perl, its probably just getting progressively slower as  
> all of the copies get started up.  If not, can the increasing times  
> be explained by increasing schema complexity?  At "$schema_class- 
> >require" is when load_classes runs and you should be mostly seeing  
> Class::C3/Alg::C3/load_components/etc initialization delays (which  
> is what I'm still working on reducing, but it may be a little  
> while).  I'm surprised that ->connection takes any significant time  
> in perl, are you sure this isn't a case of the DB server responding  
> slower and slower?

well, looked into it a bit closer:
tried it mod_perl, lighttpd and .pl
mod_perl and lighttpd are nearly the same for loading all the models,  
the .pl was twice as fast.
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.
B2B 0.049378 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Users 0.094624 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Waren 0.103613 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Stats 0.142956 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Matrix 0.155247 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
BElogs 0.236735 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Zeitung 0.278145 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Threads 0.303832 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
BEBoard 0.312186 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Calendar 0.345289 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
WBContest 0.352483 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
PDFFolder 0.372447 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
UserDepot 0.3975 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/Schema.pm  
line 304.
Newsletter 0.427306 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
Abonummern 0.438931 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
Businesspeople 0.484535 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
Exportersweekly 0.495835 at /Library/Perl/5.8.6/Catalyst/Model/DBIC/ 
Schema.pm line 304.
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?


> %Time    Sec.     #calls   sec/call  F  name
> 27.67    1.2513      259   0.004831     Algorithm::C3::merge
> 24.69    1.1163      161   0.006933      
> Class::C3::_calculate_method_dispatch_table
>  4.52    0.2042      161   0.001269      
> Class::C3::_remove_method_dispatch_table
>  3.64    0.1646       161   0.001023      
> Class::C3::_apply_method_dispatch_table
>  2.97    0.1343       98   0.001370      
> DBIx::Class::Componentised::ensure_class_loaded
>  2.75    0.1243     5837   0.000021     <anon>:...e_perl/5.8.8/ 
> Class/C3.pm:146
>  1.93    0.0871      482   0.000181      
> DBIx::Class::AccessorGroup::_mk_group_accessors
>  1.38    0.0626      183   0.000342      
> DBIx::Class::Schema::register_source

I get nearly the same results
%Time    Sec.     #calls   sec/call  F  name
32.26    3.3351     1154   0.002890      
Class::C3::_calculate_method_dispatch_table
31.97    3.3050     1236   0.002674     Algorithm::C3::merge
12.37    1.2791     1154   0.001108      
Class::C3::_remove_method_dispatch_table
4.84    0.5008     1154   0.000434      
Class::C3::_apply_method_dispatch_table
3.28    0.3387    24373   0.000014     <anon>:...y/Perl/5.8.6/Class/ 
C3.pm:146

times are ok now for me, except that apache has to kill all children  
in restart, that takes a lot of time...

thanks, will try the patches!

josef



More information about the Catalyst mailing list