Bugzilla – Attachment 35961 Details for
Bug 13690
Koha::Schema should be lazy-loaded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 13690: use Koha::Schema only when it's needed
SIGNED-OFF-Bug-13690-use-KohaSchema-only-when-its-.patch (text/plain), 1.43 KB, created by
Tomás Cohen Arazi
on 2015-02-17 04:01:47 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 13690: use Koha::Schema only when it's needed
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2015-02-17 04:01:47 UTC
Size:
1.43 KB
patch
obsolete
>From 6fb96a002f97f2fbb55325a1168944e166cfe1e8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 10 Feb 2015 11:34:10 +0100 >Subject: [PATCH] [SIGNED OFF] Bug 13690: use Koha::Schema only when it's > needed > >This patch makes Koha::Database lazy-load the whole Koha::Schema libraries. >It doesn't seem to have negative effects, and makes scripts not using >DBIx::Class notably faster [1]. > >Regards > >[1] If you read the DBIx::Class::Schema docs, it explains that it it uses >Module::Find to load all schema files... >http://search.cpan.org/~ribasushi/DBIx-Class-0.082810/lib/DBIx/Class/Schema.pm#load_namespaces > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >Happy to sign this one. The only extra comment would be that DBIx::Class >performance issues remain after this patch, but is being handled in a >different bug. >--- > Koha/Database.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Database.pm b/Koha/Database.pm >index fb72aa8..5587570 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -35,7 +35,6 @@ Koha::Database > use Modern::Perl; > use Carp; > use C4::Context; >-use Koha::Schema; > use base qw(Class::Accessor); > > use vars qw($database); >@@ -48,6 +47,7 @@ __PACKAGE__->mk_accessors(qw( )); > # returns it. > sub _new_schema { > >+ require Koha::Schema; > my $context = C4::Context->new(); > > # we are letting C4::Context->dbh not set the RaiseError handle attribute >-- >2.3.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13690
:
35796
|
35808
|
35961
|
36088