[Koha-devel] DBIx::Class vs current Koha's DBI performance

Dobrica Pavlinusic dpavlin at rot13.org
Wed Oct 27 13:15:18 CEST 2010


On Tue, Oct 26, 2010 at 02:24:24PM -0700, Fouts, Clay wrote:
> I imagine you're already aware of much of this, and that this is a proof of
> concept testbed you're publishing. I only bring it up because it's important
> that others understand the subtlety of some of the issues that caching can
> introduce, particularly when the code doesn't naturally support its use.

I am aware of this, so I implementd only caching of values which aren't
dependent on other data or user info. However, data dependent on user info
could be cached in user session (like lists and similar values).

You are correct that invalidation of caches is hard problem, but I
assume that caching over DBIx::Class would take care of invalidation,
but I might be wrong.

> My experience is that the startup overhead introduced by DBIx::Class is not
> sufficiently offset by its caching features in a CGI environment. Running
> under Plack or something similar would easily recoup that overhead, of
> course.

I did try to run it under Plack using following simple plack app which
supports just opac-search:

http://git.rot13.org/?p=koha.git;a=blob;f=app.psgi;h=7ff4c251236fb37a9d88bf84b59cfa9499e283cf;hb=658d404bf80d83f5a2875a25579f2080e6eddf7e

(sorry about long URL). However, it's not would problems: CGI::Compile
doesn't like some parts of Koha code and can't compile it (but that
would be rather easy to fix), however to make it real solution we should
first move Koha to use strict everywhere.

Another intersting bit is change at:

http://git.rot13.org/?p=koha.git;a=commit;h=8b27e87c24b8efa5f4ffc9b21b8d1a97d51f2e77

which takes marc records directly from marc instead of XML. This
bypasses XML parsing and transformation and reduces number of statements
significantly:

         old   new
stmts 1112898 786000
subs   295048 228382

(and it does show in real-life performance also, not just in profiling ;-)



More information about the Koha-devel mailing list