? Success

User tests: Successful: Unsuccessful:

avatar hordijk
hordijk
15 Jan 2015

Changed the reqex for all unknown protocols.

Removed the + character for the whitespace to solve a max_execution_timeout exception.
If you have a large output document (for example 1 mb) the regex '#\s+(src|href|poster)="(?!/|' . $protocols . '|#|\')([^"]*)"#m' takes way to long. Supporting only one \s will do the trick as well. The result will be additional spaces between attributes, but this shouldn't harm.

avatar hordijk hordijk - open - 15 Jan 2015
avatar jissues-bot jissues-bot - change - 15 Jan 2015
Labels Added: ?
avatar jissues-bot jissues-bot - change - 15 Jan 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 15 Jan 2015
Category Router / SEF
avatar nueckman
nueckman - comment - 14 Mar 2015

Looks fine


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5741.
avatar nueckman nueckman - test_item - 14 Mar 2015 - Tested successfully
avatar b2un0
b2un0 - comment - 14 Mar 2015

Looks good, should be RTC.

avatar garstud
garstud - comment - 9 May 2015

Hello @hordijk

Thank you for your contribution.
Please provide clear test instructions to be able to test this issue.
Does we need to create a big article (>1Mb), or something else ?

Thanks for understanding!


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

avatar garstud garstud - test_item - 9 May 2015 - Not tested
avatar nueckman
nueckman - comment - 12 May 2015

@garstud It's just a little performance tweak. max_execution_error is only a side effect. For testing you should load a large document (e.g. write a very large article and look at it on frontend).

avatar brianteeman
brianteeman - comment - 25 May 2015

Tried to get a time out with a massive article but failed so I cant test


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

avatar brianteeman brianteeman - test_item - 25 May 2015 - Tested unsuccessfully
avatar nueckman
nueckman - comment - 25 May 2015

@brianteeman You don't need to get a time out. Just compare the execution time.

avatar nueckman
nueckman - comment - 25 May 2015

And of course SEF has to be enabled.

avatar brianteeman
brianteeman - comment - 25 May 2015

The instructions and title both say " Fix max_execution_timeout exception"
Not compare execution time

On 25 May 2015 at 19:43, Nils Rückmann notifications@github.com wrote:

And of course SEF has to be enabled.


Reply to this email directly or view it on GitHub
#5741 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar nueckman
nueckman - comment - 25 May 2015

@brianteeman As max_execution_time is thrown after a certain time limit, it seems obvious to compare the execution time.

avatar brianteeman
brianteeman - comment - 25 May 2015

Clearly it wasnt obvious to me

On 25 May 2015 at 21:24, Nils Rückmann notifications@github.com wrote:

@brianteeman https://github.com/brianteeman As max_execution_time is
thrown after a certain time limit, it seems obvious to compare the
execution time.


Reply to this email directly or view it on GitHub
#5741 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar nueckman
nueckman - comment - 26 May 2015

Test Instructions:

  1. Write an article with a significant amount of internal links.
  2. Make sure that SEF is enabled.
  3. Browse to your article in the frontend
  4. Measure the time to load the page (for example with debug-mode)
  5. Apply the patch
  6. Measure the time to load the page again.
  7. Compare results.

Expectation:

After applying the patch, the page should be a bit faster without any side effects.

avatar designbengel
designbengel - comment - 24 Oct 2015

Tried to test it but the results are changing... :/


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

avatar anibalsanchez
anibalsanchez - comment - 6 Nov 2015

Tried to test it but I cannot verify an improvement.


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

avatar Fedik Fedik - test_item - 6 Nov 2015 - Tested successfully
avatar Fedik
Fedik - comment - 6 Nov 2015

I have tested this item :white_check_mark: successfully on 19bf76b


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

avatar Fedik
Fedik - comment - 6 Nov 2015

before patch:
regex search for 1 or more spaces
after patch:
regex check if 1 space exists

the improvement is obvious :wink:

avatar Kubik-Rubik
Kubik-Rubik - comment - 8 May 2016

Thank you for creating this. It’s been some time since you created this and there are now some merge conflicts that prevent a direct merge. Could you please update your PR? Thank you!

avatar brianteeman brianteeman - change - 2 Aug 2016
Status Pending Information Required
avatar brianteeman
brianteeman - comment - 2 Aug 2016

@hordijk Did you see the message above?


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

avatar ggppdk
ggppdk - comment - 2 Aug 2016

Ok with 1000 cases of 5000 spaces before src="..."

for ($i=0; $i < 1000; $i++)
{
    echo '<img '.str_repeat(' ', 5000).' src="http://www.some_domain_test.org/img.png" />';
}

Application afterRender

Before: 36,000 miliseconds 15 KB (compressed) / 15 KB (uncompressed)
After: 60 miliseconds 5 KB (compressed) / 4956 KB (uncompressed)

It is enough to accept on code review, it is really waste of CPU cycles to put a preg_match that starts on (without a good reason): \s+

but i also tested, (easy to test just use the code above ...)


A comment , it is not ONLY cases of space before src

  • it is ALL the cases of consecutive "white-spaces" characters that TRIGGER the regexp

think of it, it starts reading whitespace and then finds a word e.g. hello and it stops, but it has started to read the whitespace, that is the reason that this PR needs to be tested and accepted !

e.g. this will have the same effect

for ($i=0; $i < 1000; $i++)
{
    echo str_repeat(' ', 5000).' hello ';
}
avatar ggppdk ggppdk - test_item - 2 Aug 2016 - Tested successfully
avatar ggppdk
ggppdk - comment - 2 Aug 2016

I have tested this item successfully on 19bf76b

Please read my previous comment and test, the more spaces you have on a large document, the slower your joomla page gets , and this happens for no good reason
(and reason for removing spaces to make page small at a terrible cpu cycle cost, and only of the case before src/href/... is silly)

before

after


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

avatar hordijk
hordijk - comment - 2 Aug 2016

Sorry for the delay, I finally updated the PR.

avatar hordijk hordijk - close - 2 Aug 2016
avatar hordijk hordijk - reopen - 2 Aug 2016
avatar ggppdk ggppdk - test_item - 5 Aug 2016 - Tested successfully
avatar ggppdk
ggppdk - comment - 5 Aug 2016

I have tested this item successfully on 96fe585

Please see my above comment about code to test performance, about correctness you can do a core review too

https://github.com/joomla/joomla-cms/pull/5741/files


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

avatar brianteeman brianteeman - change - 5 Aug 2016
Status Information Required Pending
avatar brianteeman
brianteeman - comment - 5 Aug 2016

(set back to pending as the merge conflicts were resolved)


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

avatar ggppdk
ggppdk - comment - 13 Aug 2016

This had 2 successful tests but due to rebase ,
it show only 1 test

Also it had code reviews and the fix is obvious too,

Please see my analysis above ,
on why this is a big performance issue in large documents, the effect becomes exponential

#5741 (comment)
#5741 (comment)

This can be merged
Also this is a good reminder to avoid regexp on html that do not start with a fixed text !

avatar Sieger66 Sieger66 - test_item - 16 Aug 2016 - Tested successfully
avatar Sieger66
Sieger66 - comment - 16 Aug 2016

I have tested this item successfully on 96fe585


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

avatar ggppdk
ggppdk - comment - 16 Aug 2016

Ok now this had 3 tests

avatar roland-d roland-d - change - 3 Nov 2016
Milestone Added:
avatar roland-d roland-d - change - 3 Nov 2016
The description was changed
avatar roland-d roland-d - change - 3 Nov 2016
The description was changed
Status Pending Ready to Commit
avatar joomla-cms-bot joomla-cms-bot - change - 3 Nov 2016
Milestone Removed:
avatar roland-d
roland-d - comment - 3 Nov 2016

Setting RTC as we have multiple good tests.


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

avatar roland-d roland-d - edited - 3 Nov 2016
avatar joomla-cms-bot joomla-cms-bot - change - 3 Nov 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 3 Nov 2016
Category Router / SEF Front End Plugins Router / SEF
avatar brianteeman brianteeman - change - 3 Nov 2016
Milestone Added:
avatar roland-d roland-d - change - 13 Nov 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-11-13 00:14:19
Closed_By roland-d
avatar roland-d roland-d - close - 13 Nov 2016
avatar roland-d roland-d - merge - 13 Nov 2016
avatar roland-d roland-d - reference | b1e4a34 - 13 Nov 16
avatar roland-d roland-d - merge - 13 Nov 2016
avatar roland-d roland-d - close - 13 Nov 2016

Add a Comment

Login with GitHub to post a comment