Bugzilla – Attachment 40740 Details for
Bug 14476
Improving opac-search performances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug 14476 : Caching C4::XSLT::transformMARCXML4XSLT
bug-14476--Caching-C4XSLTtransformMARCXML4XSLT.patch (text/plain), 1.41 KB, created by
Julian FIOL
on 2015-06-30 14:12:39 UTC
(
hide
)
Description:
bug 14476 : Caching C4::XSLT::transformMARCXML4XSLT
Filename:
MIME Type:
Creator:
Julian FIOL
Created:
2015-06-30 14:12:39 UTC
Size:
1.41 KB
patch
obsolete
>From e3f61a5f84f438a17ff2cc9d9ed7c8c636cf9c42 Mon Sep 17 00:00:00 2001 >From: Julian FIOL <julian.fiol@biblibre.com> >Date: Tue, 30 Jun 2015 14:20:44 +0200 >Subject: [PATCH] bug 14476 : Caching C4::XSLT::transformMARCXML4XSLT > >This patch is improving the opac-search performances by >caching the results of C4::XSLT::transformMARCXML4XSLT > >My tests (with Devel::NYTProf) showed a gain of about >65% on C4::XSLT::transformMARCXML4XSLT and >35% on C4::XSLT::XSLTParse4Display. > >The gain of performances is increasing with the numbers >of results. >--- > C4/XSLT.pm | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 7a94f2c..91e51a6 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -68,7 +68,13 @@ Is only used in this module currently. > sub transformMARCXML4XSLT { > my ($biblionumber, $record) = @_; > my $frameworkcode = GetFrameworkCode($biblionumber) || ''; >+ my $cache = Koha::Cache->get_instance(); >+ my $cache_key = "transformMARCXML4XSLT-$biblionumber"; >+ my $cached = $cache->get_from_cache($cache_key); >+ return $cached if $cached; >+ > my $tagslib = &GetMarcStructure(1,$frameworkcode); >+ > my @fields; > # FIXME: wish there was a better way to handle exceptions > eval { >@@ -95,6 +101,7 @@ sub transformMARCXML4XSLT { > } > } > } >+ $cache->set_in_cache( "transformMARCXML4XSLT-$biblionumber", $record, { expiry => 3600 } ); > return $record; > } > >-- >2.4.3
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 14476
:
40740
|
42179