Bug 6000 - Performance enhancements for C4::Context and C4::Languages
Summary: Performance enhancements for C4::Context and C4::Languages
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: PATCH-Sent (DO NOT USE) enhancement (vote)
Assignee: Paul Poulain
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks: 5999 6193 7119
  Show dependency treegraph
 
Reported: 2011-03-29 23:00 UTC by Chris Cormack
Modified: 2014-12-07 20:02 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed Patch (5.83 KB, patch)
2011-03-29 23:04 UTC, Chris Cormack
Details | Diff | Splinter Review
Followup patch (7.06 KB, patch)
2011-03-29 23:07 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 6000 : Performance enhancing (10.16 KB, patch)
2012-01-04 16:07 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2011-03-29 23:00:43 UTC

    
Comment 1 Chris Cormack 2011-03-29 23:03:40 UTC
This probably needs a decent amount of testing.
Comment 2 Chris Cormack 2011-03-29 23:04:12 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2011-03-29 23:07:04 UTC Comment hidden (obsolete)
Comment 4 Paul Poulain 2011-10-24 11:38:13 UTC
Updating Version : This ENH will be for Koha 3.8
Comment 5 Paul Poulain 2011-10-25 15:05:47 UTC
Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday)
Comment 6 Tomás Cohen Arazi 2012-01-04 13:13:09 UTC
I think we need to define a new helper routine in Context.pm that returns the whole preferences, and memoize that one. The way it is now memoize wont help.

I'll send to HDL a proposal.
Comment 7 Tomás Cohen Arazi 2012-01-04 16:07:46 UTC
Created attachment 7037 [details] [review]
Bug 6000 : Performance enhancing

C4::Context.pm
Loads all systempreferences at once
And uses Memcached to cache them

C4::Languages
Using List::MoreUtils
Memcaching get_langage_description

Bug 6000 : Follow up Performance enhancing : C4/Languages.pm

removing a call unused to getAllLanguages
Doing better job at enabled languages

Bug 6000: Rebase against origin/master + 6193
Comment 8 Julian Maurice 2012-01-04 16:15:06 UTC
In reply to comment 7

With this code:

> my $oldsyspref = C4::Context->preference('SYSPREF');
> C4::Context->set_preference('SYSPREF', 'newvalue');
> my $newsyspref = C4::Context->preference('SYSPREF');

What is the value of $newsyspref, if C4::Context->preference is memoized ?
Comment 9 Tomás Cohen Arazi 2012-01-04 16:19:23 UTC
(In reply to comment #8)
> In reply to comment 7
> 
> With this code:
> 
> > my $oldsyspref = C4::Context->preference('SYSPREF');
> > C4::Context->set_preference('SYSPREF', 'newvalue');
> > my $newsyspref = C4::Context->preference('SYSPREF');
> 
> What is the value of $newsyspref, if C4::Context->preference is memoized ?

It's a good question for HDL.
I'd personally add a memcached->remove('SYSPREF') in the set_preference routine.
Comment 10 Tomás Cohen Arazi 2012-01-04 16:22:25 UTC
(In reply to comment #8)

Please read comment #6 as I proposed doing it other way, this time I just rebased against origin/master + 6193 (to be signed off patch). I'm willing to discuss how to implement this on IRC.
Comment 11 Paul Poulain 2012-02-03 10:03:15 UTC
Setting "in discussion", as other caching-related bugs
Comment 12 Paul Poulain 2012-02-21 12:26:54 UTC
This patch does not apply now that bug 6193 has been applied. And I think this entry should be dropped in favour of some more granular entries.
Marking "failed QA", and I suggest we "abandon" this one