[Koha-bugs] [Bug 15341] Performance - Retrieve all sysprefs at once

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 10 13:18:15 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15341

--- Comment #7 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Jacek Ablewicz from comment #6)
> (In reply to Jonathan Druart from comment #4)
> > (In reply to Frédéric Demians from comment #2)
> > > Isn't plack supposed to bring some persistency? And so couldn't we have
> > > preferences available somewhere from one page to the other?
> > 
> > Both psgi files (debian/templates/plack.psgi and misc/plack/koha.psgi)
> > disable the syspref cache (C4::Context->disable_syspref_cache();), see bug
> > 13805.
> 
> Not good ;). But in my tests, with this patch applied, it is even worse -
> when syspref cache is disabled:
> 
>    #!/usr/bin/perl
>    use Modern::Perl;
>    use C4::Context;
> 
>    C4::Context->disable_syspref_cache();
> 
>    my @sysprefs = qw/
>      UseTransportCostMatrix
>      StaticHoldsQueueWeight
>      RandomizeHoldsQueueWeight/;
> 
>    for (my $i = 0; $i < 1000; $i++) {
>      for my $syspref_name (@sysprefs) {
>        my $syspref_val = C4::Context->preference($syspref_name);
>      }
>    }
> 
> Runnig time - without patch: 4.4sec, with patch: 47.2 sec..
> 
> With syspref cache enabled, the difference is negglible (0.36 patched, 0.37
> sec unpatched), but the patched version still seems to be a bit slower (but
> not much, <2 usec per call - hard to measure, in real life scenarios I guess
> it will also depend on the mysql query_cache_limit/size/type settings etc.).

Yes, I have tested *with* the syspref cache (I should have mentioned that in
the commit msg!)
What you described is expected, you are not running under Plack and for each
call all pref are retrieved from the DB :)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list