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

Brandon Black blblack at gmail.com
Sun Jul 9 00:21:41 CEST 2006


On 7/8/06, Matija Grabnar <matija at literal.si> 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.
>
>

My example loadtime was also from a schema that was split out across a
directory structure instead of a single file, but mine had a full
complement of column attributes.  Schema::Loader will be adding these
attributes to generated schemas by default in the next version.

-- Brandon



More information about the Dbix-class mailing list