? Failure

User tests: Successful: Unsuccessful:

avatar frankmayer
frankmayer
2 Oct 2016

[UPDATED (8.1.2017) - see third paragraph]
Some optimization and cleanup work on the indexer part, which might improve its performance a bit.

Summary of Changes

  • I removed some senseless parts of the fr.php getStem() method (given that this part did work correctly in this state). The explanation is that the condition if (($matches[2] != '*') || ($intact)) was always true because of $intact being always true. So this part was removed. The associated else part was removed for the same reason.
  • fixed a bug in query.php on lines 197 & 207 where previously checks were performed on the wrong options.
  • replaced some count($var) which were essentially checking if the array is not empty and some !empty($var) methods with a faster alternative which is (bool) $var.
    While for count() this is up to 2.5 times faster (according to my own benchmarks), there is only about a 10% performance gain when replacing !empty() (Which basically seems to be the inversion of !empty(), see here).

The rest is some cleanup and optimizations here and there:

  • Replace deprecated JString
  • Fix some ambiguous PREG parameters
  • Type safe comparisons
  • docblock fixes
  • Removed some unnecessary conditions
  • Simplifications of nested positive ifs and ternary operators to Elvis
  • Added a few fields to token in order to not adding them dynamically, which is more expensive

[Update 8.1.2017]
Since this PR, I have also submitted a few others relating to the indexer. These should best be merged before this one. After that, I can resolve the conflicts, here.

  • Work on com_finder (both admin and site) #12254
  • [Indexer] Replace StringHelper::trim() calls with simple trim() #13478
  • Optimized FinderIndexerHelper->stem() method #13480
  • Cleanup and optimization in FinderIndexerDrivers #13511

Testing Instructions

Code review should suffice

avatar frankmayer frankmayer - open - 2 Oct 2016
avatar frankmayer frankmayer - change - 2 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Oct 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 2 Oct 2016
Category Administration Components CLI
avatar frankmayer
frankmayer - comment - 2 Oct 2016

I have noticed the failed checks. Working on it.

avatar frankmayer frankmayer - change - 13 Dec 2016
The description was changed
avatar joomla-cms-bot joomla-cms-bot - change - 13 Dec 2016
Category Administration Components CLI Administration com_finder CLI Components
avatar andrepereiradasilva
andrepereiradasilva - comment - 13 Dec 2016

I have tested this item successfully on 5f3cd39

code review


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

avatar andrepereiradasilva andrepereiradasilva - test_item - 13 Dec 2016 - Tested successfully
avatar frankmayer
frankmayer - comment - 26 Dec 2016

I wonder if this one could get pushed to the top, as it provides a few optimizations, that especially in this case could make a difference in performance, because of the many loops and comparisons, etc.

avatar frankmayer frankmayer - edited - 6 Jan 2017
avatar frankmayer frankmayer - change - 8 Jan 2017
The description was changed
avatar frankmayer frankmayer - edited - 8 Jan 2017
avatar frankmayer frankmayer - change - 8 Jan 2017
The description was changed
avatar frankmayer frankmayer - edited - 8 Jan 2017
avatar frankmayer frankmayer - change - 8 Jan 2017
The description was changed
avatar frankmayer frankmayer - edited - 8 Jan 2017
avatar frankmayer frankmayer - edited - 8 Jan 2017
avatar frankmayer frankmayer - change - 5 Feb 2017
The description was changed
avatar frankmayer frankmayer - edited - 5 Feb 2017
avatar rdeutz rdeutz - change - 27 May 2017
The description was changed
avatar frankmayer frankmayer - change - 28 Jun 2017
The description was changed
avatar frankmayer frankmayer - edited - 28 Jun 2017
avatar frankmayer frankmayer - change - 25 Jul 2017
The description was changed
avatar frankmayer frankmayer - edited - 25 Jul 2017
avatar frankmayer frankmayer - change - 1 Aug 2017
The description was changed
avatar frankmayer frankmayer - edited - 1 Aug 2017
avatar frankmayer
frankmayer - comment - 1 Aug 2017

@andrepereiradasilva & @Quy could you guys give a green light for this PR? You have already done the code review in the past and there were only minor changes to this PR as @Quy proposed. Thanks guys.

avatar frankmayer
frankmayer - comment - 4 Aug 2017

Bump @wilsonge would be nice if we can also get this in? @andrepereiradasilva had tested it and @Quy had a few suggestions, which I adapted afterwards. Essentially we have one successful test at the moment, with a few minor changes afterwards.

avatar frankmayer
frankmayer - comment - 24 Aug 2017

@wilsonge, @mbabker any chance this one can make it into 3.8 or are we too far along?
It was reviewed and deemed ok, prior to some resolving of conflicts.

avatar frankmayer
frankmayer - comment - 25 Aug 2017

@mbabker BTW, I do have some more work on type-safe comparisons, which I have split up into 7 branches. They only need code review. Shall I make those PR's now for inclusion into 3.8.0 or later for 3.8.1 or 3.9?

avatar frankmayer
frankmayer - comment - 8 Nov 2017

@mbabker Bump for 3.9?

avatar frankmayer
frankmayer - comment - 13 Mar 2018

@mbabker bump? This PR is one and a half years old, now... (Remark: This was tested successfully by one peer before doing some minor proposed changes/conflict resolutions)

avatar Quy
Quy - comment - 13 Mar 2018

To reproduce:

  • Click Clear Index button.
  • Click Index button.

In the PHP error log:

PHP Notice:  Trying to get property 'term' of non-object in \administrator\components\com_finder\helpers\indexer\indexer.php on line 523
PHP Notice:  Trying to get property 'stem' of non-object in \administrator\components\com_finder\helpers\indexer\indexer.php on line 524
PHP Notice:  Trying to get property 'common' of non-object in \administrator\components\com_finder\helpers\indexer\indexer.php on line 525
PHP Notice:  Trying to get property 'phrase' of non-object in \administrator\components\com_finder\helpers\indexer\indexer.php on line 526
PHP Notice:  Trying to get property 'weight' of non-object in \administrator\components\com_finder\helpers\indexer\indexer.php on line 527
PHP Notice:  Trying to get property 'language' of non-object in \administrator\components\com_finder\helpers\indexer\indexer.php on line 529
avatar frankmayer
frankmayer - comment - 14 Mar 2018

@Quy is this the result of you testing this PR again? And those notices were not there prior to the patch?

avatar Quy
Quy - comment - 14 Mar 2018

I may have only did code review previously. Yes these notices generated with this PR.

avatar frankmayer
frankmayer - comment - 14 Mar 2018

OK, thanks, I'll take a look.

avatar roland-d
roland-d - comment - 22 Jul 2018

@frankmayer Can you have a look at the notices?

avatar Tchangue Tchangue - test_item - 23 Jul 2018 - Tested successfully
avatar Tchangue
Tchangue - comment - 23 Jul 2018

I have tested this item successfully on 0944ec9

Reviewed code. Everything fine.
@icampus


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

avatar durubayram durubayram - test_item - 23 Jul 2018 - Tested successfully
avatar durubayram
durubayram - comment - 23 Jul 2018

I have tested this item successfully on 0944ec9


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Jul 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 Jul 2018

Ready to Commit after two successful tests.

avatar brianteeman
brianteeman - comment - 23 Jul 2018

please remove RTC until the reported php notices are resolved #12253 (comment)

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Jul 2018
Status Ready to Commit Pending
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 Jul 2018

reset Status on "Pending" as stated above.


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

avatar roland-d
roland-d - comment - 24 Jul 2018

@frankmayer Can you please address the mentioned issue so we can move it forward?

avatar frankmayer
frankmayer - comment - 7 Aug 2018

Sorry for the delay people. Had lots of other stuff on my plate. Will try to resolve this ASAP. Thanks

avatar frankmayer
frankmayer - comment - 7 Aug 2018

Should be OK now. Thanks for testing and reporting the issue.

avatar frankmayer
frankmayer - comment - 7 Aug 2018

I think the drone failure is false... can someone restart that or will I have to push again?

avatar roland-d
roland-d - comment - 7 Aug 2018

@frankmayer The drone failure is because of this:

07 08 2018 16:58:13.155:ERROR [Firefox 59.0.0 (Ubuntu 0.0.0)]: TypeError: a.ui is undefined
at http://localhost:9876/base/media/jui/js/jquery.ui.sortable.min.js?3ebfa0c205cdb3b90e6858aea5c05607b57e93c8:17
avatar mbabker
mbabker - comment - 7 Aug 2018

It's the same constant false positive. Don't worry about it.

avatar rdeutz
rdeutz - comment - 7 Aug 2018

in this case we had two different wrongly failed test :-) all good now.

avatar roland-d roland-d - test_item - 7 Aug 2018 - Tested successfully
avatar roland-d
roland-d - comment - 7 Aug 2018

I have tested this item successfully on 8125d35

After applying the PR I have done the following tests:

  1. Run the indexer, indexing goes well
  2. Search different terms and ways on the frontend
  3. Added a search filter
  4. Menu item using a search filter

All without problems.


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

avatar frankmayer
frankmayer - comment - 7 Aug 2018

Ah, great :) Thanks guys. And thank you @roland-d for testing 👍

avatar frankmayer
frankmayer - comment - 7 Aug 2018

@Quy can you make the second human test in order to finally give this one a proper send-off? ;)

avatar Quy Quy - test_item - 8 Aug 2018 - Tested successfully
avatar Quy
Quy - comment - 8 Aug 2018

I have tested this item successfully on 8125d35


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

avatar Quy Quy - change - 8 Aug 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 8 Aug 2018

RTC


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

avatar mbabker mbabker - change - 21 Aug 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-08-21 03:57:01
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 21 Aug 2018
avatar mbabker mbabker - merge - 21 Aug 2018
avatar dagalumin
dagalumin - comment - 9 Oct 2018

This working on indexer released with 3.8.12 has introduced some issues in saving and indexing large articles. Please see issue #22098 and #22220

Add a Comment

Login with GitHub to post a comment