[CDBI] Make CDBI go fast

John Siracusa siracusa at mindspring.com
Thu Feb 15 16:34:36 GMT 2007

On 2/15/07, Michael G Schwern <schwern at gmail.com> wrote:
> * What about using another ORM?
> The basic table classes are all generated from YAML schema files so there is
> some flexibility to move to another ORM.  As the tests are weak and the code
> is complex I want to alter as little of the application code as possible.  It
> would have to have a very good CDBI wrapper.
> * What about Rose-DB?
> I know nothing about it.  I'm open to convincing.  I don't see a CDBI
> compatibility layer.

There is none.  Although writing one wouldn't be hard, it's not
something I'm particularly interested in doing :)  I know some people
have written their own "80%" CDBI compatibility layers on top of RDBO,
and I've personally helped with one CDBI -> RDBO transition, but AFAIK
no code like this has been released to CPAN.

I'm not going to try to convince you that RDBO is the right choice for
your particular situation (in fact, it may not be), but I do recommend
downloading the Rose::DB::Object (and dependencies, yada) if only to
get access to the benchmark suite that's bundled with it.  It tests
CDBI, CDBI::Sweet, DBIC, RDBO, and straight DBI.  Although it may not
test exactly what you want to test, it's a reasonable way to gauge the
progress of your performance enhancements to CDBI (and, tangentially,
how you stack up against other ORMs).  You can see some (somewhat out
of date) results here:


(I plan to refresh those results before the next RDBO release this month.)

Unfortunately, the benchmark suite is not designed to test CDBI vs.
"my hacked CDBI" in a single run.  But you can of course run the
benches twice, once with your hacked CDBI in @INC and once with the
standard version.  Or you could add your custom CDBI to the benchmark
with some judicious copy/paste/edit of the existing CDBI tests.  If
you run into any trouble getting the benchmark script to run, post
here or on the RDBO list:



More information about the ClassDBI mailing list