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

Matija Grabnar matija at literal.si
Sat Jul 8 17:23:59 CEST 2006


> 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.





More information about the Dbix-class mailing list