User tests: Successful: Unsuccessful:
This is related to #8863. I looked into JMenu::getItems() to see if this could be optimized further. While this is a small optimization, it still means that the count operation only has to be run once instead of for each menu item. The number of attributes does not change during this method call, so we can move this to the beginning of the method instead of it being part of the for-loop.
Thanks @volandku for this one, too.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
it would be performance loss in case of:
for ($i = 0; $i < count($attributes); $i++)
In existing code all fine, for me. As I remember the first part of the for() loop is not called each cycle.
so I do not see the profit in suggested changes, just moving the code around?
Suggest to look again: The for loop you are referring to is within the for loop of _items!
Not to worry, it was the first thing I checked. Viewing the complete source helps to put things in perspective. The reputation of Hannes (Hackwar) also helps, of course.
I have tested this item successfully on 5f0b23d
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-01-10 16:06:51 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
I have tested this item successfully on 5f0b23d
Thanks.
IMHO, all performance optimizations (even small ones), and especially the ones in parts of Joomla that are used in every sites, are a +100.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8864.