[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2022-06-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Fridolin Somers  changed:

   What|Removed |Added

   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=30920

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2022-01-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Andrew Fuerste-Henry  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|Pushed to stable|RESOLVED
 CC||and...@bywatersolutions.com

--- Comment #35 from Andrew Fuerste-Henry  ---
Enhancement, not backporting to 21.05. Please ask if needed.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2022-01-07 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #34 from Fridolin Somers  ---
(In reply to Tomás Cohen Arazi from comment #32)
> This patch introduces a warning on tests:
> $ prove t/db_dependent/Template/Plugin/Branches.t
> Use of uninitialized value $branchcode in concatenation (.) or string at
> /kohadevbox/koha/Koha/Template/Plugin/Branches.pm line 35.
> 
> I'm not sure if it is ok to  call GetName with no branchcode param. Maybe it
> should explode in those cases as it is obviously a bug.

I've created Bug 29826

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2022-01-07 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Fridolin Somers  changed:

   What|Removed |Added

 Blocks||29826


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826
[Bug 29826] Remove warning in t/db_dependent/Template/Plugin/Branches.t
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2022-01-07 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Kyle M Hall  changed:

   What|Removed |Added

 Version(s)|22.05.00|22.05.00,21.11.02
released in||
 CC||k...@bywatersolutions.com
 Status|Pushed to master|Pushed to stable

--- Comment #33 from Kyle M Hall  ---
Pushed to 21.11.x for 21.11.02

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2022-01-06 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Tomás Cohen Arazi  changed:

   What|Removed |Added

 CC||tomasco...@gmail.com

--- Comment #32 from Tomás Cohen Arazi  ---
This patch introduces a warning on tests:
$ prove t/db_dependent/Template/Plugin/Branches.t
Use of uninitialized value $branchcode in concatenation (.) or string at
/kohadevbox/koha/Koha/Template/Plugin/Branches.pm line 35.

I'm not sure if it is ok to  call GetName with no branchcode param. Maybe it
should explode in those cases as it is obviously a bug.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #31 from Fridolin Somers  ---
Pushed to master for 22.05, thanks to everybody involved 濾

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Fridolin Somers  changed:

   What|Removed |Added

 Status|Passed QA   |Pushed to master
 Version(s)||22.05.00
released in||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #30 from Fridolin Somers  ---
OK super.

Good to have several feedbacks it help understanding how we develop.

So OK with this key, makes sens to reuse it.

I see we have a wiki page for that :
https://wiki.koha-community.org/wiki/Cache_handling_in_Koha#What_is_cached.3F

I'll had this case and try to improve this doc.

Best regards

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #29 from Jonathan Druart  ---
To me the key is correct and actually perfect as it, we can imagine another
method using it as well. It's storing a map of branchcode => branchname, no
need to be more specific IMO.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #28 from David Cook  ---
(In reply to David Cook from comment #27)
> I suppose the cache key is debateable. I don't think we have an index of
> cache keys, so Frido might be right about making a more targeted cache key,
> so that there isn't an accidental collision with another script that stores
> different data using the same key.

Sorry I shouldn't have said another script since it's a L1 cache. I mean a
different module/function.

That said, the risk seems fairly low of that happening...

If we did have an index, re-using the same cache key across different modules
seems appealing to me.

I'm on the fence.

On one hand, this is already Passed QA, so maybe we leave it as is, and just
change it later if it's an issue.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #27 from David Cook  ---
(In reply to Fridolin Somers from comment #26)
> (In reply to Jonathan Druart from comment #21)
> > Created attachment 128446 [details] [review] [review]
> > Bug 26587: Use Koha::Cache::Memory::Lite
> 
> Great.
> 
> But in my opinion cache key is too short :
>   my $cache_key= "Library_branchname:" . $branchcode;
> We may have need for library datas cache in other places.
> 
> I propose :
>   my $cache_key= "Template_Plugin_Branches_branchname:" . $branchcode;

Good call on using Koha::Cache::Memory::Lite. 

I suppose the cache key is debateable. I don't think we have an index of cache
keys, so Frido might be right about making a more targeted cache key, so that
there isn't an accidental collision with another script that stores different
data using the same key.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #26 from Fridolin Somers  ---
(In reply to Jonathan Druart from comment #21)
> Created attachment 128446 [details] [review]
> Bug 26587: Use Koha::Cache::Memory::Lite

Great.

But in my opinion cache key is too short :
  my $cache_key= "Library_branchname:" . $branchcode;
We may have need for library datas cache in other places.

I propose :
  my $cache_key= "Template_Plugin_Branches_branchname:" . $branchcode;

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #25 from Nick Clemens  ---
Created attachment 128471
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128471=edit
Bug 26587: Use Koha::Cache::Memory::Lite

Signed-off-by: Nick Clemens 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Nick Clemens  changed:

   What|Removed |Added

 Attachment #127411|0   |1
is obsolete||
 Attachment #128446|0   |1
is obsolete||

--- Comment #24 from Nick Clemens  ---
Created attachment 128470
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128470=edit
Bug 26587: Cache libraries in Koha/Template/Plugins/Branches.pm to improve
performance

This patch caches the Koha::Library object in a hashmap in the Branches object
(GetName, GetURL)
to avoid multiple database lookups while looping many items.

To test:
1. Have a biblio with many items (1000's).
2. View in staff (detail.pl) and opac (opac-detail.pl). Note how long it takes
to load.
3. Apply patch.
4. Repeat 2. Note that pages load faster.

Sponsored-by: Lund University Library
JK: replaced tab indendation with spaces
Signed-off-by: Joonas Kylmälä 

Signed-off-by: Nick Clemens 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Nick Clemens  changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Jonathan Druart  changed:

   What|Removed |Added

   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=29454

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #23 from Jonathan Druart  ---
(In reply to Jonathan Druart from comment #22)
> (In reply to Fridolin Somers from comment #16)
> > Maybe we could prefer using Koha::Cache::Memory::Lite like in other places :
> > https://git.koha-community.org/Koha-community/Koha/src/commit/
> > 2e6b5483503e7feb0afc6ef526a675bde767dd8e/Koha/AuthorisedValues.pm#L104
> > 
> > In order to avoid having different cache features.
> 
> I second that and I submitted a patch. I haven't noticed any significant
> changes in perf between the 2 versions (always 21-22s).

vs 25-26s using master.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #22 from Jonathan Druart  ---
(In reply to Fridolin Somers from comment #16)
> Maybe we could prefer using Koha::Cache::Memory::Lite like in other places :
> https://git.koha-community.org/Koha-community/Koha/src/commit/
> 2e6b5483503e7feb0afc6ef526a675bde767dd8e/Koha/AuthorisedValues.pm#L104
> 
> In order to avoid having different cache features.

I second that and I submitted a patch. I haven't noticed any significant
changes in perf between the 2 versions (always 21-22s).

Tested using 1000 items with the following script to generate the biblio
record:

use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
my @branchcodes = Koha::Libraries->search->get_column('branchcode');
my $biblio = $builder->build_sample_biblio;
for my $i ( 1..1000 ) { 
say $i; 
my $branchcode = @branchcodes[int(rand(scalar @branchcodes))];
$builder->build_sample_item({biblionumber => $biblio->biblionumber,
homebranch => $branchcode, holdingbranch => $branchcode }); 
}
say "biblionumber=".$biblio->biblionumber;

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #21 from Jonathan Druart  ---
Created attachment 128446
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128446=edit
Bug 26587: Use Koha::Cache::Memory::Lite

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 26587] Cache libraries in Branches TT plugin to improve performance

2021-12-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

Jonathan Druart  changed:

   What|Removed |Added

Summary|detail.pl is very slow for  |Cache libraries in Branches
   |records with many items |TT plugin to improve
   ||performance

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/