Bugzilla – Attachment 48653 Details for
Bug 15350
DBIx::Class Startup speed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15350: Move the import of Koha::Schema to a basic `use`
Bug-15350-Move-the-import-of-KohaSchema-to-a-basic.patch (text/plain), 1.44 KB, created by
Jesse Weaver
on 2016-03-03 21:34:28 UTC
(
hide
)
Description:
Bug 15350: Move the import of Koha::Schema to a basic `use`
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2016-03-03 21:34:28 UTC
Size:
1.44 KB
patch
obsolete
>From 45609d22aa474ceca3f674728e9519523912f28c Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <jweaver@bywatersolutions.com> >Date: Tue, 1 Mar 2016 13:44:22 -0700 >Subject: [PATCH] Bug 15350: Move the import of Koha::Schema to a basic `use` > >This moves 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. > >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 >--- > Koha/Database.pm | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/Koha/Database.pm b/Koha/Database.pm >index a8f4eab..6d64506 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -35,6 +35,7 @@ Koha::Database > use Modern::Perl; > use Carp; > use C4::Context; >+use Koha::Schema; > use base qw(Class::Accessor); > > use vars qw($database); >@@ -46,9 +47,6 @@ __PACKAGE__->mk_accessors(qw( )); > # database connection from the data given in the current context, and > # returns it. > sub _new_schema { >- >- require Koha::Schema; >- > my $context = C4::Context->new(); > > my $db_driver = $context->{db_driver}; >-- >2.7.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 15350
:
45606
|
48519
| 48653