? Pending

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
23 Oct 2018

Summary of Changes

Calls to Joomla\CMS\Factory::getUser() without specifying the user ID (i.e. to get the currently logged in user) are expensive because this always ends up calling Joomla\CMS\Session\Session::get(). In the admin mod_menu, we repetitively call this method to do ACL checks on menu items in the JAdminCssMenu class. We can make a micro-optimization of the module's performance by injecting the user we're getting in the module's main file when instantiating this class.

Therefore, this PR changes the module to inject that user instance, and for B/C this constructor argument is optional until 4.0.

You can review the call graph comparison at https://blackfire.io/profiles/compare/e6c27a22-f126-4539-9406-032cc260658e/graph to see how many fewer calls there are as a result, which also creates a small performance enhancement.

Testing Instructions

With the patch applied, navigate the backend. The admin menu is correctly assembled.

avatar mbabker mbabker - open - 23 Oct 2018
avatar mbabker mbabker - change - 23 Oct 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Oct 2018
Category Modules Administration
avatar SharkyKZ
SharkyKZ - comment - 9 Nov 2018

I have tested this item successfully on ea752d5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22806.

avatar SharkyKZ SharkyKZ - test_item - 9 Nov 2018 - Tested successfully
avatar phproberto
phproberto - comment - 10 Nov 2018

I have tested this item successfully on ea752d5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22806.

avatar phproberto phproberto - test_item - 10 Nov 2018 - Tested successfully
avatar Quy Quy - change - 10 Nov 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 10 Nov 2018

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22806.

avatar laoneo laoneo - change - 12 Nov 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-11-12 13:18:22
Closed_By laoneo
Labels Added: ?
avatar laoneo laoneo - close - 12 Nov 2018
avatar laoneo laoneo - merge - 12 Nov 2018

Add a Comment

Login with GitHub to post a comment