[Bug 16168] New: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Bug ID: 16168 Summary: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: abl@biblos.pk.edu.pl QA Contact: testopia@bugs.koha-community.org Right now, ->dbh calls are actually quite expensive (they involve DB connection health checks, each and every time). Some speed-sensitive subroutines inside C4/Biblio.pm (GetMarcStructure, GetAuthorisedValueDesc) have this statement my $dbh = C4::Context->dbh; on top of the code, but they don't always/don't usually need DB handle - not at that stage at least. This trivial patch eliminates unneeded ->dbh calls in those subroutines. With it, average GetMarcStructure() running time goes down from 14 miliseconds to 9 miliseconds (on top of Bug 16166), it also makes catalogue search profiling a bit easier. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jacek Ablewicz <ablewicz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 --- Comment #1 from Jacek Ablewicz <ablewicz@gmail.com> --- Created attachment 49677 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49677&action=edit Bug 16168: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm Right now, ->dbh calls are actually quite expensive (they involve DB connection health checks, each and every time). Some speed-sensitive subroutines inside C4/Biblio.pm (GetMarcStructure, GetAuthorisedValueDesc) have this statement my $dbh = C4::Context->dbh; on top of the code, but they don't always/don't usually need DB handle - not at that stage at least. This trivial patch eliminates unneeded ->dbh calls in those subroutines. With it, average GetMarcStructure() running time goes down from 14 miliseconds to 9 miliseconds (on top of Bug 16166), it also makes catalogue search profiling a bit easier. Test plan: 1) apply patch 2) ensure that catalogue searches are still working 3) run t/*Biblio* tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |abl@biblos.pk.edu.pl See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16156 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15342 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15342 [Bug 15342] Performance 3.22 - Omnibus -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #49677|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 49679 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49679&action=edit Bug 16168: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm Right now, ->dbh calls are actually quite expensive (they involve DB connection health checks, each and every time). Some speed-sensitive subroutines inside C4/Biblio.pm (GetMarcStructure, GetAuthorisedValueDesc) have this statement my $dbh = C4::Context->dbh; on top of the code, but they don't always/don't usually need DB handle - not at that stage at least. This trivial patch eliminates unneeded ->dbh calls in those subroutines. With it, average GetMarcStructure() running time goes down from 14 miliseconds to 9 miliseconds (on top of Bug 16166), it also makes catalogue search profiling a bit easier. Test plan: 1) apply patch 2) ensure that catalogue searches are still working 3) run t/*Biblio* tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 49679 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49679 Bug 16168: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm Review of attachment 49679: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=16168&attachment=49679) ----------------------------------------------------------------- ::: C4/Biblio.pm @@ +2618,4 @@
sub TransformMarcToKoha { my ( $dbh, $record, $frameworkcode, $limit_table ) = @_; + ## FIXME: $dbh parameter is never used inside this subroutine ???
Do you plan to work on it? Otherwise I will provide a patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16169 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16169 [Bug 16169] TransformMarcToKoha should not take $dbh in parameters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #3)
Comment on attachment 49679 [details] [review] Bug 16168: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm
Review of attachment 49679 [details] [review]: -----------------------------------------------------------------
::: C4/Biblio.pm @@ +2618,4 @@
sub TransformMarcToKoha { my ( $dbh, $record, $frameworkcode, $limit_table ) = @_; + ## FIXME: $dbh parameter is never used inside this subroutine ???
Done on bug 16169. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 --- Comment #5 from Jacek Ablewicz <abl@biblos.pk.edu.pl> --- (In reply to Jonathan Druart from comment #3)
Comment on attachment 49679 [details] [review] Bug 16168: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm
Review of attachment 49679 [details] [review]: -----------------------------------------------------------------
::: C4/Biblio.pm @@ +2618,4 @@
sub TransformMarcToKoha { my ( $dbh, $record, $frameworkcode, $limit_table ) = @_; + ## FIXME: $dbh parameter is never used inside this subroutine ???
Do you plan to work on it?
Nah, too many changes in too many places ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #49679|0 |1 is obsolete| | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 49828 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49828&action=edit [PASSED QA] Bug 16168: Eliminate unneeded C4::Context->dbh calls in C4/Biblio.pm Right now, ->dbh calls are actually quite expensive (they involve DB connection health checks, each and every time). Some speed-sensitive subroutines inside C4/Biblio.pm (GetMarcStructure, GetAuthorisedValueDesc) have this statement my $dbh = C4::Context->dbh; on top of the code, but they don't always/don't usually need DB handle - not at that stage at least. This trivial patch eliminates unneeded ->dbh calls in those subroutines. With it, average GetMarcStructure() running time goes down from 14 miliseconds to 9 miliseconds (on top of Bug 16166), it also makes catalogue search profiling a bit easier. Test plan: 1) apply patch 2) ensure that catalogue searches are still working 3) run t/*Biblio* tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16168 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |brendan@bywatersolutions.co | |m --- Comment #7 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - Should be in the May 2016 release. Thanks! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org