Skip to content

Conversation

@ggppdk
Copy link
Contributor

@ggppdk ggppdk commented Aug 16, 2016

Pull Request for Issue #10997

Fixes performance of creating" Select Page" filter (= menu item filter) in modules manager

Summary of Changes

Removed unused left join, joining menu items table with itself for no reason

No reason because

  1. Join is LEFT
  2. The results of the join are not used anywhere
  • neither in SELECT clause nor WHERE clause and not in any other clause
  • There is no PHP code that adds some usage of it under some condition

There is already another (different) self-join for the table on the lft/rgt, similar to the one removed when we limit to a specific parent parent

Testing Instructions

Visit module manager and open search filters, the "Select page" filter should be same as before, and behave as before

Documentation Changes Required

none

@ggppdk ggppdk changed the title Fix performance retrieve menu items in menus helper (e.g. creating select drop downs with menu items) Fix performance retrieve menu items in menus helper, e.g. when creating "Select page" filter in modules manager Aug 16, 2016
@ggppdk ggppdk changed the title Fix performance retrieve menu items in menus helper, e.g. when creating "Select page" filter in modules manager Fix performance retrieving menu items in menus helper, e.g. when creating "Select page" filter in modules manager Aug 16, 2016
@prathumwan
Copy link

tested successful, speed is back.

@andrepereiradasilva
Copy link
Contributor

@prathumwan please mark as tested with success in https://issues.joomla.org/tracker/joomla-cms/11627?nocache
Login with github as mark as tested with success

@prathumwan
Copy link

I have tested this item ✅ successfully on

search filter for page works, performance is back


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

@ggppdk
Copy link
Contributor Author

ggppdk commented Aug 17, 2016

@prathumwan

also, since you have big set of menu items

besides this PR, also please see PR #11628 that

  • fixes performance of menu item FORM

(fixes performance creating menuparent form element, (edit an item that belongs to a large menu)

Go to your largest menu and edit an item there:
then edit it with applying this patch: #11628 , and reply there and not here

@alikon
Copy link
Contributor

alikon commented Aug 18, 2016

I have tested this item ✅ successfully on 7a19975


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

@ggppdk
Copy link
Contributor Author

ggppdk commented Aug 18, 2016

This PR patches the menus helper method: MenusHelper::getMenuLinks()

  • so the performance is fixed in all places that use it

That is wherever a menu item select drop is created e.g. "search filter" "select page" in modules manager

and also edit forms that have assignments to menu items

  • template edit form
  • module edit form
administrator\components\com_modules\views\module\tmpl\edit_assignment.php(14): $menuTypes = MenusHelper::getMenuLinks();
administrator\components\com_templates\views\style\tmpl\edit_assignment.php(14): $menuTypes = MenusHelper::getMenuLinks();
administrator\templates\hathor\html\com_modules\module\edit_assignment.php(14): $menuTypes = MenusHelper::getMenuLinks();
administrator\templates\hathor\html\com_templates\style\edit_assignment.php(14): $menuTypes = MenusHelper::getMenuLinks();
libraries\cms\form\field\menuitem.php(160):         $items = MenusHelper::getMenuLinks($menuType, 0, 0, $this->published, $this->language);

@andrepereiradasilva
Copy link
Contributor

ok so with a small menu (15 menu items) we can still notice the changes:

Before patch

image

After patch

image

Note: Code i used for test:

!JDEBUG ?: JProfiler::getInstance('Application')->mark('- start query');
$links = $db->loadObjectList();
!JDEBUG ?: JProfiler::getInstance('Application')->mark('- end query');

@andrepereiradasilva
Copy link
Contributor

I have tested this item ✅ successfully on 7a19975

as comment above


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

@andrepereiradasilva
Copy link
Contributor

can we have RTC here?

@brianteeman
Copy link
Contributor

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 21, 2016
@rdeutz rdeutz added this to the Joomla 3.6.3 milestone Aug 22, 2016
@rdeutz rdeutz merged commit 57f44a1 into joomla:staging Aug 22, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 22, 2016
roland-d pushed a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants