Bug 32693 - The 'About Koha' page loads slowly
Summary: The 'About Koha' page loads slowly
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: About (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Pedro Amorim
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 36039
  Show dependency treegraph
 
Reported: 2023-01-20 19:22 UTC by David Nind
Modified: 2024-03-10 00:31 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement improves the 'About Koha' page loading time. Instead of loading all the tabs at once, the content is loaded when the tab is selected.
Version(s) released in:


Attachments
Bug 32693: Proof of concept (14.72 KB, patch)
2024-02-07 16:46 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Proof of concept (13.49 KB, patch)
2024-02-08 10:10 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Proof of concept (14.69 KB, patch)
2024-02-08 10:13 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Update tab_item html helper (1.38 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Update tab_items (2.78 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Update tab_panels (163.09 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: docdir (1.68 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: Move template params (1.93 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: versions (1.21 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: About script: (59.32 KB, patch)
2024-02-15 14:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32693: Update tab_item html helper (1.42 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: Update tab_items (2.82 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: Update tab_panels (163.13 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: docdir (1.72 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: Move template params (1.98 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: versions (1.25 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: About script: (59.36 KB, patch)
2024-02-15 18:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 32693: Update tab_item html helper (1.50 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32693: Update tab_items (2.90 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32693: Update tab_panels (163.21 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: docdir (1.80 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: Move template params (2.05 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32693: Preparation: About script: versions (1.33 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32693: About script: Process only the tab being queried (59.44 KB, patch)
2024-03-01 10:55 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Nind 2023-01-20 19:22:36 UTC
The 'About Koha' page in the staff interface is noticeably slower to load than other pages in the staff interface (for me, anyway).

Using the browser web developer network tools, it shows it took about 4-5 seconds to load the first time (after a flush_memcached, restart_all, and a browser with a cleared cache). Subsequent loads are a lot quicker (about 1-2 seconds).
Comment 1 Pedro Amorim 2024-02-07 16:46:37 UTC
Created attachment 161832 [details] [review]
Bug 32693: Proof of concept

This is a PoC for discussion.
Now, only the tab being viewed is processed and loaded.
Comment 2 David Nind 2024-02-07 18:16:14 UTC
Thanks Pedro!

I was keen to test your PoC, but got this when trying to apply the patch:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 32693: Proof of concept
.git/rebase-apply/patch:65: trailing whitespace.
    
error: sha1 information is lacking or useless (about.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 32693: Proof of concept
Comment 3 Pedro Amorim 2024-02-08 10:10:18 UTC
Created attachment 161881 [details] [review]
Bug 32693: Proof of concept

This is a PoC for discussion.
Now, only the tab being viewed is processed and loaded.
Comment 4 Pedro Amorim 2024-02-08 10:10:52 UTC
(In reply to David Nind from comment #2)
> Thanks Pedro!
> 
> I was keen to test your PoC, but got this when trying to apply the patch:
> 
> Apply? [(y)es, (n)o, (i)nteractive] y
> Applying: Bug 32693: Proof of concept
> .git/rebase-apply/patch:65: trailing whitespace.
>     
> error: sha1 information is lacking or useless (about.pl).
> error: could not build fake ancestor
> Patch failed at 0001 Bug 32693: Proof of concept

Apologies, this was written on top of other work unintentionally.
I've rebased and should apply nicely now.
Comment 5 Pedro Amorim 2024-02-08 10:13:59 UTC
Created attachment 161883 [details] [review]
Bug 32693: Proof of concept

This is a PoC for discussion.
Now, only the tab being viewed is processed and loaded.
Comment 6 David Nind 2024-02-09 13:17:35 UTC
Notes from testing (using KTD)
==============================

I would say this makes a really good difference - apart from the System information tab, every other tab feels faster to load.

I'm assuming for the system information tab that there is a lot to check, and this will depend on the Koha instance configuration.

Before the patch
~~~~~~~~~~~~~~~~

- Initial: 19 requests 1.23 MB / 59.46 kB transferred Finish: 3.77 s DOMContentLoaded: 3.75 s load: 3.75 s
- Reload (go somewhere else, such as the home page, then go back to the Abut Koha page): 18 requests 875.75 kB / 59.45 kB transferred Finish: 1.28 s DOMContentLoaded: 1.26 s load: 1.27 s
- Refresh the page (Shift + Refresh button): 30 requests 1.78 MB / 389.59 kB transferred Finish: 1.38 s DOMContentLoaded: 1.37 s load: 1.39 s

Note: With a refresh, a recurring error is (Bug 34973): downloadable font: Glyph bbox was incorrect (glyph ids 1 2 3 .......) (font-family: "Font Awesome 6 Free" style:normal weight:900 stretch:100 src index:0) source: http://127.0.0.1:8081/intranet-tmpl/lib/fontawesome/webfonts/fa-solid-900.woff2

After applying the PoC patch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(plus a flush_memcached, restart_all, and a fresh browser)

Server information tab: 
- Initial: 19 requests 382.89 kB / 6.41 kB transferred Finish: 636 ms DOMContentLoaded: 612 ms load: 613 ms
- Reload: 19 requests 165.26 kB / 29.78 kB transferred Finish: 653 ms DOMContentLoaded: 643 ms load: 652 ms
- Refresh: 29 requests 891.46 kB / 336.53 kB transferred Finish: 603 ms DOMContentLoaded: 593 ms load: 610 ms

Perl modules tab: 
- Initial: 18 requests 514.49 kB / 10.18 kB transferred Finish: 1.12 s DOMContentLoaded: 1.12 s load: 1.12 s
- Reload: 18 requests 215.33 kB / 10.18 kB transferred Finish: 528 ms DOMContentLoaded: 519 ms load: 521 ms
- Refresh: 30 requests 1.12 MB / 340.32 kB transferred Finish: 579 ms DOMContentLoaded: 564 ms load: 582 ms

System information tab
- Initial: 18 requests 28.45 kB / 5.70 kB transferred Finish: 3.13 s DOMContentLoaded: 3.11 s load: 3.11 s
- Reload: 18 requests 28.45 kB / 5.70 kB transferred Finish: 1.17 s DOMContentLoaded: 1.16 s load: 1.16 s
- Refresh: 30 requests 936.88 kB / 335.83 kB transferred Finish: 1.37 s DOMContentLoaded: 1.34 s load: 1.37 s

(One warning in default KTD: Warning System preference 'RequireChoosingExistingAuthority' is disabled, but needs 'AutoCreateAuthorites' enabled. Otherwise catalogers can add headings that will not be linked to authorities)

Koha team tab:
- Initial: 18 requests 127.34 kB / 18.85 kB transferred Finish: 577 ms DOMContentLoaded: 573 ms load: 598 ms
- Reload: 18 requests 127.34 kB / 18.86 kB transferred Finish: 632 ms DOMContentLoaded: 627 ms load: 630 ms
- Refresh: 30 requests 1.04 MB / 349 kB transferred Finish: 664 ms DOMContentLoaded: 621 ms load: 672 ms

Licenses tab:
- Initial: 18 requests 41.74 kB / 8.21 kB transferred Finish: 510 ms DOMContentLoaded: 487 ms load: 494 ms
- Reload: 18 requests 41.74 kB / 8.21 kB transferred Finish: 511 ms DOMContentLoaded: 494 ms load: 495 ms
- Refresh: 30 requests 950.17 kB / 338.34 kB transferred Finish: 522 ms DOMContentLoaded: 506 ms load: 527 ms

Translations tab:
- Initial: 18 requests 31.09 kB / 7.35 kB transferred Finish: 497 ms DOMContentLoaded: 492 ms load: 493 ms
- Reload: 18 requests 31.09 kB / 7.35 kB transferred Finish: 499 ms DOMContentLoaded: 496 ms load: 497 ms
- Refresh: 29 requests 889.17 kB / 337.48 kB transferred Finish: 510 ms DOMContentLoaded: 504 ms load: 516 ms

Timeline tab:
- Initial: 18 requests 554.09 kB / 35.05 kB transferred Finish: 591 ms DOMContentLoaded: 563 ms load: 591 ms 
- Reload: 18 requests 554.09 kB / 35.06 kB transferred Finish: 576 ms DOMContentLoaded: 547 ms load: 574 ms
- Refresh: 30 requests 1.46 MB / 365.19 kB transferred Finish: 606 ms DOMContentLoaded: 604 ms load: 613 ms 

Dedications tab:
- Initial: 19 requests 159.28 kB / 29.19 kB transferred Finish: 509 ms DOMContentLoaded: 501 ms load: 508 ms
- Reload: 18 requests 27.39 kB / 5.82 kB transferred Finish: 487 ms DOMContentLoaded: 473 ms load: 474 ms
- Refresh: 30 requests 935.83 kB / 335.96 kB transferred Finish: 518 ms DOMContentLoaded: 504 ms load: 524 ms
Comment 7 Pedro Amorim 2024-02-09 17:00:38 UTC
David, that's great, thank you so much for this analysis.

I think the biggest improvement for me here is the much shorter time to first render. With this patch, whenever you click the "About" main menu item (default server information tab), it's no longer a slog.

If others agree with this approach (Katrin, Martin, Tomas, Joubu?), I'll pick this back up to finish and tidy up the patch for submission. If not, or there are other better alternative suggestions, please do say.
Comment 8 Martin Renvoize 2024-02-15 10:30:52 UTC
This is a great improvement; It's something I've always intended to do but never hit the top of the pile.

Yes please, do the final polishing you see fit Pedro, I think this, and the subsequent bugs that apply on top will really help system administrators with spotted issues.
Comment 9 Pedro Amorim 2024-02-15 14:43:30 UTC Comment hidden (obsolete)
Comment 10 Pedro Amorim 2024-02-15 14:43:32 UTC Comment hidden (obsolete)
Comment 11 Pedro Amorim 2024-02-15 14:43:35 UTC Comment hidden (obsolete)
Comment 12 Pedro Amorim 2024-02-15 14:43:38 UTC Comment hidden (obsolete)
Comment 13 Pedro Amorim 2024-02-15 14:43:41 UTC Comment hidden (obsolete)
Comment 14 Pedro Amorim 2024-02-15 14:43:43 UTC Comment hidden (obsolete)
Comment 15 Pedro Amorim 2024-02-15 14:43:46 UTC Comment hidden (obsolete)
Comment 16 David Nind 2024-02-15 18:58:20 UTC
Created attachment 162219 [details] [review]
Bug 32693: Update tab_item html helper

tab_item html helper now allows for a boolean tablink option to set if the the tab item is a link or not

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 David Nind 2024-02-15 18:58:23 UTC
Created attachment 162220 [details] [review]
Bug 32693: Update tab_items

tab_items are now linktabs
tab_items are now styled active depending if the URL param 'tab' matches the tab name or not

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 David Nind 2024-02-15 18:58:26 UTC
Created attachment 162221 [details] [review]
Bug 32693: Update tab_panels

Each tab panel's content has now been moved to its own BLOCK.
Each tab panel's content is now only loaded if said tab is the one being viewed

Signed-off-by: David Nind <david@davidnind.com>
Comment 19 David Nind 2024-02-15 18:58:29 UTC
Created attachment 162222 [details] [review]
Bug 32693: Preparation: About script: docdir

docdir is used in both team + history tabs
was previously being loaded in team and additionally used in history
but because now we're only loading one tab at a time, we need to move this

Signed-off-by: David Nind <david@davidnind.com>
Comment 20 David Nind 2024-02-15 18:58:32 UTC
Created attachment 162223 [details] [review]
Bug 32693: Preparation: About script: Move template params

These template params are only used in the default first 'about' tab but were being added further down in the script

Signed-off-by: David Nind <david@davidnind.com>
Comment 21 David Nind 2024-02-15 18:58:34 UTC
Created attachment 162224 [details] [review]
Bug 32693: Preparation: About script: versions

versions is being used in both 'team' and 'about' tabs, needs to be
moved

Signed-off-by: David Nind <david@davidnind.com>
Comment 22 David Nind 2024-02-15 18:58:38 UTC
Created attachment 162225 [details] [review]
Bug 32693: About script:

Process only the tab being queried

Signed-off-by: David Nind <david@davidnind.com>
Comment 23 David Nind 2024-02-15 19:07:02 UTC
Have signed off. I hope this was reading for testing!

I repeated the timings from comment #6, and things seem to load even faster (particularly the system information tab: 2.37s, 599ms, and 970ms respectively).

All the tabs look OK and display as expected for me (tested using Firefox and Chromium).

Improving the page titles and breadcrumb would be a bonus (instead of just 'About Koha'), but I think that could be a separate bug - happy to create it.
Comment 24 Marcel de Rooy 2024-03-01 10:40:21 UTC
About is slow. But this feels much more as enh than bugfix. Correct me if I am mistaken..
Comment 25 Pedro Amorim 2024-03-01 10:48:25 UTC
(In reply to Marcel de Rooy from comment #24)
> About is slow. But this feels much more as enh than bugfix. Correct me if I
> am mistaken..

Agreed. Yes.
Comment 26 Jonathan Druart 2024-03-01 10:55:27 UTC
Created attachment 162660 [details] [review]
Bug 32693: Update tab_item html helper

tab_item html helper now allows for a boolean tablink option to set if the the tab item is a link or not

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 27 Jonathan Druart 2024-03-01 10:55:30 UTC
Created attachment 162661 [details] [review]
Bug 32693: Update tab_items

tab_items are now linktabs
tab_items are now styled active depending if the URL param 'tab' matches the tab name or not

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 28 Jonathan Druart 2024-03-01 10:55:33 UTC
Created attachment 162662 [details] [review]
Bug 32693: Update tab_panels

Each tab panel's content has now been moved to its own BLOCK.
Each tab panel's content is now only loaded if said tab is the one being viewed

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 29 Jonathan Druart 2024-03-01 10:55:36 UTC
Created attachment 162663 [details] [review]
Bug 32693: Preparation: About script: docdir

docdir is used in both team + history tabs
was previously being loaded in team and additionally used in history
but because now we're only loading one tab at a time, we need to move this

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 30 Jonathan Druart 2024-03-01 10:55:39 UTC
Created attachment 162664 [details] [review]
Bug 32693: Preparation: About script: Move template params

These template params are only used in the default first 'about' tab but were being added further down in the script

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 31 Jonathan Druart 2024-03-01 10:55:42 UTC
Created attachment 162665 [details] [review]
Bug 32693: Preparation: About script: versions

versions is being used in both 'team' and 'about' tabs, needs to be
moved

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 32 Jonathan Druart 2024-03-01 10:55:45 UTC
Created attachment 162666 [details] [review]
Bug 32693: About script: Process only the tab being queried

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>