? Success

User tests: Successful: Unsuccessful:

avatar alikon
alikon
1 Dec 2015

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

1) You need to have 100 articles in one category

2) at the begin of prepareTable() https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L222 add

JDEBUG ? $time=microtime(true) : null;
JDEBUG ? JLog::addLogger(array('text_file' => 'testPR8576.php', ), JLog::INFO) : null;

at the end https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L243 add

JDEBUG ? JLog::add('prepareTable():'.round(microtime(true) - $time, 3), JLog::INFO) : null;

3) we do the same on featured() https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/article.php#L595 add

JDEBUG ? $time=microtime(true) : null;

and

JDEBUG ? JLog::add('Featured():'.round(microtime(true) - $time, 3), JLog::INFO) : null;

at the end

4) enable the debug plugin

5) 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

logimage

performance gain measurements

i've runned a cli script that create 100 featured articles in 1 category without the patch
bulk100

it takes something like 500 seconds

i've runned the same script as before with the patch applyed
bulk100p

as you can see now takes only something like 70 seconds

Comments

the $table->reorder() was insanely invoked in the artcle model
and this cause to run a lot of unncessary updates for the ordering field on the #__ content , #__content_frontapage tables

avatar alikon alikon - open - 1 Dec 2015
avatar alikon alikon - change - 1 Dec 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Dec 2015
Labels Added: ?
avatar sovainfo
sovainfo - comment - 6 Dec 2015

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.

avatar Bodge-IT
Bodge-IT - comment - 15 Feb 2016

Not seeing these times when creating new featured articles.
Can you be specific for final line number in featured(). Should it sit after "return true;" (L683)
Do the 100 articles all need to be featured?

avatar alikon
alikon - comment - 15 Feb 2016

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

avatar Bodge-IT
Bodge-IT - comment - 15 Feb 2016

Now have a 109 articles.

New featured articles:
2016-02-15T20:08:33+00:00 INFO 82.69.61.42 - prepareTable():0.865
2016-02-15T20:08:33+00:00 INFO 82.69.61.42 - Featured():0.008
2016-02-15T20:09:40+00:00 INFO 82.69.61.42 - prepareTable():0.87
2016-02-15T20:09:40+00:00 INFO 82.69.61.42 - Featured():0.14
2016-02-15T20:10:14+00:00 INFO 82.69.61.42 - prepareTable():0.952
2016-02-15T20:10:14+00:00 INFO 82.69.61.42 - Featured():0.131

avatar alikon
alikon - comment - 16 Feb 2016

are these result from before apply this #pr or after ?
can you publish both results

avatar AmayAgrawal
AmayAgrawal - comment - 25 Feb 2016

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.

avatar waader waader - test_item - 27 Feb 2016 - Tested successfully
avatar waader
waader - comment - 27 Feb 2016

I have tested this item :white_check_mark: successfully on 0e61eda

Category with 500 featured articles:

results before:
2016-02-27T18:11:43+00:00 INFO 127.0.0.1 - prepareTable():0.872
2016-02-27T18:11:44+00:00 INFO 127.0.0.1 - Featured():0.75
2016-02-27T18:12:02+00:00 INFO 127.0.0.1 - prepareTable():0.78
2016-02-27T18:12:03+00:00 INFO 127.0.0.1 - Featured():0.77

and after:
2016-02-27T18:16:48+00:00 INFO 127.0.0.1 - prepareTable():0.002
2016-02-27T18:16:48+00:00 INFO 127.0.0.1 - Featured():0.012
2016-02-27T18:16:51+00:00 INFO 127.0.0.1 - prepareTable():0
2016-02-27T18:16:51+00:00 INFO 127.0.0.1 - Featured():0.02


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

avatar brianteeman brianteeman - change - 30 Mar 2016
Category Components
avatar webmiep
webmiep - comment - 15 Apr 2016

I have tested this succesfully

#Date: 2016-04-15 15:09:59 UTC
#Software: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

#Fields: datetime priority clientip category message
----------before patch-----------
2016-04-15T15:09:59+00:00 INFO 159.100.68.158 - prepareTable():0.08
2016-04-15T15:10:21+00:00 INFO 159.100.68.158 - prepareTable():0.116
2016-04-15T15:10:44+00:00 INFO 159.100.68.158 - prepareTable():0.088
-----------after patch-------------
2016-04-15T15:17:00+00:00 INFO 159.100.68.158 - prepareTable():0.001
2016-04-15T15:17:21+00:00 INFO 159.100.68.158 - prepareTable():0.003
2016-04-15T15:17:41+00:00 INFO 159.100.68.158 - prepareTable():0.001


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

avatar webmiep webmiep - test_item - 15 Apr 2016 - Tested successfully
avatar webmiep
webmiep - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 0e61eda


#Date: 2016-04-15 15:09:59 UTC
#Software: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

#Fields: datetime priority clientip category message
----------before patch-----------
2016-04-15T15:09:59+00:00 INFO 159.100.68.158 - prepareTable():0.08
2016-04-15T15:10:21+00:00 INFO 159.100.68.158 - prepareTable():0.116
2016-04-15T15:10:44+00:00 INFO 159.100.68.158 - prepareTable():0.088
-----------after patch-------------
2016-04-15T15:17:00+00:00 INFO 159.100.68.158 - prepareTable():0.001
2016-04-15T15:17:21+00:00 INFO 159.100.68.158 - prepareTable():0.003
2016-04-15T15:17:41+00:00 INFO 159.100.68.158 - prepareTable():0.001


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

avatar roland-d roland-d - change - 15 Apr 2016
Status Pending Ready to Commit
avatar roland-d
roland-d - comment - 15 Apr 2016

Setting RTC as we have 2 successful commits


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

avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 15 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - change - 15 Apr 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-04-15 18:58:04
Closed_By rdeutz
avatar rdeutz rdeutz - close - 15 Apr 2016
avatar rdeutz rdeutz - merge - 15 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 15 Apr 2016
avatar rdeutz rdeutz - reference | 584440d - 15 Apr 16
avatar rdeutz rdeutz - merge - 15 Apr 2016
avatar rdeutz rdeutz - close - 15 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment