User tests: Successful: Unsuccessful:
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.
With the patch applied, navigate the backend. The admin menu is correctly assembled.
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
|
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.