Feature PR-5.2-dev Performance Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
14 Sep 2024

Pull Request for Issue #43649.

Summary of Changes

Currently while checking access, the Access::preload() pulling everything from the access table.
It is neglectable for small sites, however for large sites it has huge impact on the site performance.

I added a new method for "smart preload", which allows to preload only needed items. And applied this method for most of the com_content views, where it make sense.

Testing Instructions

Create a site with 20k articles (more is better). Can use following plugin to generate random content https://github.com/Fedik/plg_sampledata_bigdata

Enable debug.
Open article detail or blog view.
Look for memory usage in the debug bar, and for time.

Actual result BEFORE applying this Pull Request

In my test:
memory usage around 45Mb
time 200-300ms

Expected result AFTER applying this Pull Request

In my test:
memory usage around ~12Mb
time ~100ms

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 14 Sep 2024
avatar Fedik Fedik - change - 14 Sep 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2024
Category Administration com_categories com_content Front End Libraries
avatar Fedik
Fedik - comment - 14 Sep 2024

Will rebase it after upmarge

avatar Fedik Fedik - change - 14 Sep 2024
The description was changed
avatar Fedik Fedik - edited - 14 Sep 2024
avatar Fedik Fedik - change - 14 Sep 2024
Labels Added: Feature bug PR-5.2-dev
avatar Fedik Fedik - change - 14 Sep 2024
Title
[5.3][Performance] Access smart preload, reduce memory use and time for large sites
[5.3][Performance] Access Rules smart preload, reduce memory use and time for large sites
avatar Fedik Fedik - edited - 14 Sep 2024
avatar Fedik
Fedik - comment - 14 Sep 2024

Is it faster if you add these indexes?
ALTER TABLE `#__assets` ADD INDEX `idx_lft` (`lft`), ADD INDEX `idx_rgt` (`rgt`);

Nope, unfortunately. Before applying the index it took ~250ms, and after ~250ms.

It probably skipping index because of range check:
Screenshot 2024-09-14_14-09-28

avatar Fedik Fedik - change - 14 Sep 2024
The description was changed
avatar Fedik Fedik - edited - 14 Sep 2024
avatar Fedik Fedik - change - 14 Sep 2024
The description was changed
avatar Fedik Fedik - edited - 14 Sep 2024
avatar Fedik Fedik - change - 14 Sep 2024
The description was changed
avatar Fedik Fedik - edited - 14 Sep 2024
avatar Fedik Fedik - change - 14 Sep 2024
The description was changed
avatar Fedik Fedik - edited - 14 Sep 2024
avatar Fedik Fedik - change - 1 Oct 2024
The description was changed
avatar Fedik Fedik - edited - 1 Oct 2024
avatar Fedik Fedik - change - 3 Oct 2024
Labels Added: Performance
Removed: bug

Add a Comment

Login with GitHub to post a comment