[CDBI] Make CDBI go fast
d.rowles at outcometechnologies.com
Thu Feb 15 10:30:02 GMT 2007
Michael G Schwern wrote:
> * Inflate columns into objects on demand.
> CDBI inflates columns as soon as they are fleshed out. If the inflated column is never accessed then its a plain waste. If a class has relationships it can result in a cascade of inflations and object loads.
If I remember correctly, when inflating columns which are part of a
"has_a" relationship, Class::DBI just calls the _simple_bless() method,
which won't go to the database at all. So this is probably less of a
problem than you think. I don't think you can get cascading database
loads this way.....
> * Speed up id() and primary_column() (probably by caching primary_column)
> In profiling I've found CDBI spends too much time calculating an object's id. A lot of this is determining the primary columns and then calculating an id from it. This all can probably be cached in the object.
Or, create a method in the child class called "id" when the user calls
"__PACKAGE__->columns(Primary => qw/ whatever /)".
Good luck with your project :)
t: +44 (0)207 656 2460
f: +44 (0)709 230 6588
m: +44 (0)798 076 8143
e: d.rowles at outcometechnologies.com
15-19 Bloomsbury Way
London WC1A 2BA
***This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you receive this message in error, please return it to the
More information about the ClassDBI