? Success

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
8 Jan 2016

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.

avatar Hackwar Hackwar - open - 8 Jan 2016
avatar Hackwar Hackwar - change - 8 Jan 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jan 2016
Labels Added: ?
avatar andrepereiradasilva andrepereiradasilva - test_item - 9 Jan 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 9 Jan 2016

I have tested this item :white_check_mark: 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.

avatar Fedik
Fedik - comment - 9 Jan 2016

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? :wink:

avatar andrepereiradasilva
andrepereiradasilva - comment - 9 Jan 2016

Yeah, i checked the code diff and i think @Fedik is right.

avatar sovainfo
sovainfo - comment - 9 Jan 2016

Suggest to look again: The for loop you are referring to is within the for loop of _items!

avatar Fedik
Fedik - comment - 9 Jan 2016

@sovainfo okay okay, I take my words back :smile:

avatar andrepereiradasilva
andrepereiradasilva - comment - 9 Jan 2016

Ups, must be sleeping, yes, there is a for before.
thanks @sovainfo.
So the test remains ok. :)

avatar sovainfo
sovainfo - comment - 9 Jan 2016

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.

avatar Fedik Fedik - test_item - 9 Jan 2016 - Tested successfully
avatar Fedik
Fedik - comment - 9 Jan 2016

I have tested this item :white_check_mark: successfully on 5f0b23d


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

avatar wilsonge wilsonge - change - 10 Jan 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-01-10 16:06:51
Closed_By wilsonge
avatar wilsonge wilsonge - close - 10 Jan 2016
avatar wilsonge wilsonge - reference | 3576e2f - 10 Jan 16
avatar wilsonge wilsonge - merge - 10 Jan 2016
avatar wilsonge wilsonge - close - 10 Jan 2016
avatar wilsonge wilsonge - change - 10 Jan 2016
Milestone Added:

Add a Comment

Login with GitHub to post a comment