[Dbix-class] Startup times for DBIX::Class

Jess Robinson castaway at desert-island.demon.co.uk
Sat Jul 15 13:22:06 CEST 2006



On Sat, 8 Jul 2006, Matija Grabnar wrote:

>
>> But seriously, I think you should also look at your local setup for
>> optimizations.  30 tables in what appears to be 8 seconds seems a bit
>> slow.
> Yeah, no kidding. Note that that schema was generated by sql fairy, and
> put in a single file.
> I dug around some more today, and generated a schema by using the line
> from the DBIx::Class::Schema::Loader manpage
>
> perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e 'make_schema_at("New::Schema::Name", { relationships => 1 }, [ "dbi:Pg:dbname=foo","postgres" ])'
>
> The result was a schema in a directory.
>
> The improvement is INCREDIBLE: The loading of the same database, on the same machine, is down
> to 1.25 seconds. AND this schema has relationships defined - I had to add them to the sqlt one by hand,
> and I just added the ones my script needed, not all of them. WOW!
>
> I notice that the column metadata in this schema is limited to just the names of columns, however,
> so it's less suitable for making it a base from which future changes can be deployed.
> But given the reduced loading time, I am certainly willing to live with that limitation.
>

Loading from a single file versus many is slower? I wonder why, that 
sounds odd to me, given that it only has to parse/load one file in the 
first instance.

Maybe the load diference is in the amount of column_info, or the rels..

Out of curiosity, which DB is it? The sqlt method should get your 
relationships just fine..

Jess




More information about the Dbix-class mailing list