Bugzilla – Attachment 42179 Details for
Bug 14476
Improving opac-search performances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] bug 14476 : Caching C4::XSLT::transformMARCXML4XSLT
SIGNED-OFF-bug-14476--Caching-C4XSLTtransformMARCX.patch (text/plain), 1.49 KB, created by
Gaetan Boisson
on 2015-09-01 18:17:22 UTC
(
hide
)
Description:
[SIGNED-OFF] bug 14476 : Caching C4::XSLT::transformMARCXML4XSLT
Filename:
MIME Type:
Creator:
Gaetan Boisson
Created:
2015-09-01 18:17:22 UTC
Size:
1.49 KB
patch
obsolete
>From 1cbf5be498e928938dc532d5ae6a906e17d913b4 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] [SIGNED-OFF] 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. > >Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com> >--- > 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.1.4
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