Bugzilla – Attachment 43007 Details for
Bug 14932
serials/serials-collection.pl-page is very slow. GetFullSubscription* checks permission for each serial!
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14932 - serials/serials-collection.pl-page is very slow. GetFullSubscription* checks permission for each serial!
Bug-14932---serialsserials-collectionpl-page-is-ve.patch (text/plain), 2.17 KB, created by
Olli-Antti Kivilahti
on 2015-10-01 12:57:20 UTC
(
hide
)
Description:
Bug 14932 - serials/serials-collection.pl-page is very slow. GetFullSubscription* checks permission for each serial!
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-10-01 12:57:20 UTC
Size:
2.17 KB
patch
obsolete
>From b99cc6cb941cd26c7eab0998cb193eadc2971e8f Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Thu, 1 Oct 2015 15:23:23 +0300 >Subject: [PATCH] Bug 14932 - serials/serials-collection.pl-page is very slow. > GetFullSubscription* checks permission for each serial! > >Currently we have subscriptions with 300+ serials received. >It takes a lot of time to show serials-collection.pl (~20s). >This is especially troublesome when receiving serials, since after receival we get redirected to that page. > >We no longer can receive daily serials in the allotted timeframe. > >This quick and dirty fix prevents checking the subscription editing for each serial, but instead checks it for the first serial only. > >This reduced page load time by ~18s > >TEST PLAN: >1. Receive ~300 serials (or just a bunch :) ) >2. Observe the gradual slowing of the receival action. > >AFTER THIS PATCH: >1. Receive ~300 serials more (or just a bunch) >2. Observe a significant performance improvement. >--- > C4/Serials.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index f8f5dd0..973ac46 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -390,8 +390,9 @@ sub GetFullSubscription { > my $sth = $dbh->prepare($query); > $sth->execute($subscriptionid); > my $subscriptions = $sth->fetchall_arrayref( {} ); >+ my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if ref($subscriptions) eq 'ARRAY'; > for my $subscription ( @$subscriptions ) { >- $subscription->{cannotedit} = not can_edit_subscription( $subscription ); >+ $subscription->{cannotedit} = $cannotedit; > } > return $subscriptions; > } >@@ -544,8 +545,9 @@ sub GetFullSubscriptionsFromBiblionumber { > my $sth = $dbh->prepare($query); > $sth->execute($biblionumber); > my $subscriptions = $sth->fetchall_arrayref( {} ); >+ my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if ref($subscriptions) eq 'ARRAY'; > for my $subscription ( @$subscriptions ) { >- $subscription->{cannotedit} = not can_edit_subscription( $subscription ); >+ $subscription->{cannotedit} = $cannotedit; > } > return $subscriptions; > } >-- >1.9.1
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 14932
:
43007
|
61974
|
62111
|
62112