Performance gain - new featured article#8576
Performance gain - new featured article#8576rdeutz merged 1 commit intojoomla:stagingfrom alikon:performance-1
Conversation
|
As requested I performed a code review and it looks ok to me, apart from the fact the comments need to reflect the changed code. Struggling to determine the impact of your change, not being familiar enough with this part of com_content. |
|
Not seeing these times when creating new featured articles. |
|
should go before https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L672 if the 100 articles are featured already, the slowness should be more evident |
|
Now have a 109 articles. |
|
are these result from before apply this #pr or after ? |
|
Sir you have written that in the logs folder open testpr8576.php but it does not have such file.Can u specify the url or something where should i test. |
|
I have tested this item ✅ successfully on 0e61eda results before: and after: This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8576. |
|
I have tested this succesfully #Date: 2016-04-15 15:09:59 UTC #Fields: datetime priority clientip category message This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8576. |
|
I have tested this item ✅ successfully on 0e61eda #Fields: datetime priority clientip category message This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8576. |
|
Setting RTC as we have 2 successful commits This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8576. |
Follow up
How to reproduce the issue
this issue arise when you create a new article (featured) in a category of 100 or more articles
when you save a new one you should notice that it takes a lot of time
How to test
You need to have 100 articles in one category
at the begin of
prepareTable()https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L222 addat the end https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L243 add
featured()https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L595 addand
at the end
enable the debug plugin
create a new featured article in the category with 100 articles
repeat 5) two or 3 times
in the logs folder open testPR8576.php you'll see how much time cost
Apply the pacth
and redo the same hack 2), 3) as before
repeat 5) two or 3 times
reopen testPR8576.php you should notice the gain
performance gain measurements
i've runned a cli script that create 100 featured articles in 1 category without the patch

it takes something like 500 seconds
i've runned the same script as before with the patch applyed

as you can see now takes only something like 70 seconds
Comments
the
$table->reorder()was insanely invoked in the artcle modeland this cause to run a lot of unncessary updates for the
orderingfield on the#__ content,#__content_frontapagetables