[Koha-bugs] [Bug 15350] DBIx::Class Startup speed

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 1 21:52:33 CET 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15350

--- Comment #3 from Jesse Weaver <jweaver at bywatersolutions.com> ---
Created attachment 48519
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48519&action=edit
Bug 15350: Cache loaded DBIx::Class schema classes

This separates the Koha::Schema creation into two stages:

 1) The loading of the schemas themselves, which is done upon import of
    Koha::Database. This requires moving the import of Koha::Schema from
    an on-demand `require` to just a `use`; most everything in Koha uses
    C4::Context, which will indirectly end up calling
    Koha::Database->schema->new anyway, so this was no longer saving
    anything.
 2) The actual database connection, which is done by cloning the schema
    created above and adding a database connection.

Note that this saves time only when a Plack-based Koha needs to create
a database connection, which is usually only the case for a new worker.

Unscientific timings before patch:
  * First load of koha2marclinks.pl on a new worker: 0.70 seconds
  * Each load after: 0.17 seconds

After patch:
  * First load: 0.31 seconds
  * Each load after: 0.17 seconds

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list