User tests: Successful: Unsuccessful:
Follow up
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
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
and redo the same hack 2), 3) as before
repeat 5) two or 3 times
reopen testPR8576.php you should notice the gain
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
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
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
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?
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.
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
are these result from before apply this #pr or after ?
can you publish both results
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
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
Category | ⇒ | Components |
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
I have tested this item 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
Status | Pending | ⇒ | Ready to Commit |
Setting RTC as we have 2 successful commits
Labels |
Added:
?
|
Milestone |
Added: |
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 |
Labels |
Removed:
?
|
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
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.