Bugzilla – Attachment 50280 Details for
Bug 16221
Use Storable::dclone() instead of Clone::clone() for L1 cache deep-copying mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16221: Use Storable::dclone() instead of Clone::clone() for L1 cache deep-copying mode
Bug-16221-Use-Storabledclone-instead-of-Cloneclone.patch (text/plain), 1.87 KB, created by
Jonathan Druart
on 2016-04-15 15:44:50 UTC
(
hide
)
Description:
Bug 16221: Use Storable::dclone() instead of Clone::clone() for L1 cache deep-copying mode
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-04-15 15:44:50 UTC
Size:
1.87 KB
patch
obsolete
>From 20b77e0a04cf5c0b4765ab71c4e378525e26d312 Mon Sep 17 00:00:00 2001 >From: Jacek Ablewicz <abl@biblos.pk.edu.pl> >Date: Thu, 7 Apr 2016 10:26:31 +0200 >Subject: [PATCH] Bug 16221: Use Storable::dclone() instead of Clone::clone() > for L1 cache deep-copying mode > >Storable dclone() is over 3x faster then Clone::clone() when used for >creating a deep copies of the big, complex data structures like MARC >frameworks. See also Bug 16044 comments #18 & #20. > >This is a trivial version of Bug 16166. Performance test >results (see Bug 16140 comment #23 for test setup description): > >146.29 (14.64+14.53+14.51+14.57+14.72+14.56+14.53+15.06+14.56+14.61) > >96.5 (9.77+9.63+9.77+9.77+9.68+9.05+9.68+9.83+9.63+9.69) > >90.7 (9.15+9.10+9.16+8.41+9.19+9.19+9.11+9.19+9.02+9.18) > >Bug 16166 is a bit faster and more comprehensive implementation, but >also more complex and harder to test/evaluate. > >Test plan: > >1) apply patch >2) profile GetMarcStructure() calls before / after patch, e.g. by >running some script which calls it often (like catalogue search >w/ XSLT processing turned on, etc.) > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Cache.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Cache.pm b/Koha/Cache.pm >index 02a4712..3d996d8 100644 >--- a/Koha/Cache.pm >+++ b/Koha/Cache.pm >@@ -38,7 +38,7 @@ The first, traditional OO interface provides the following functions: > use strict; > use warnings; > use Carp; >-use Clone qw( clone ); >+use Storable qw(dclone); > use Module::Load::Conditional qw(can_load); > use Koha::Cache::Object; > >@@ -342,7 +342,7 @@ sub get_from_cache { > # Or if we do not need to deep copy > return $L1_cache{$key} > if not ref $L1_cache{$key} or $unsafe; >- return clone $L1_cache{$key}; >+ return dclone $L1_cache{$key}; > } > > my $get_sub = $self->{ref($self->{$cache}) . "_get"}; >-- >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 16221
:
50011
|
50077
|
50280
|
50281
|
50288
|
50289
|
50321
|
50322