Skip to content

Conversation

@SeanHenderson
Copy link
Contributor

IE versions greater then 9 do not handle the old regular expression well
with large html content.

@mgol
Copy link
Member

mgol commented Sep 2, 2015

We need you to sign our CLA before accepting a PR.

@mgol mgol self-assigned this Sep 2, 2015
@SeanHenderson
Copy link
Contributor Author

done

@mgol
Copy link
Member

mgol commented Sep 2, 2015

Did you invoke npm install? The Git commit hook would tell you the commit message is incorrect, it's missing a component Manipulation. The format for marking the bug closed is also different, please read https://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines.

Otherwise, the code looks good.

@SeanHenderson
Copy link
Contributor Author

I don't have node installed. I have updated the commit message as requested.

@mgol
Copy link
Member

mgol commented Sep 2, 2015

Component:Manipulation should be Manipulation: COMMIT_MESSAGE, for example:

Manipulation: Switch rnoInnerhtml to a version more performant in IE

The rest of the commit message looks good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, i wonder, do we have similar regexps? Would be helpful to have a comment, which would point to the microsoft tracker issue and perf suite

IE versions greater than 9 do not handle the old regular expression well with large html content
This is due to the use of a non-capturing group after a very common html character (<).

Test suite: http://jsfiddle.net/Lwa0t5rp/3/
Microsoft bug: https://connect.microsoft.com/IE/feedback/details/1736512/regular-expressions-are-slower-in-edge-than-in-ie8

Fixes gh-2563
Closes gh-2568
@SeanHenderson
Copy link
Contributor Author

I have added additional detail to the commit message. Similar regular expressions exist but I didn't find one that will be used on large strings that might have the same kind of impact.

@SeanHenderson SeanHenderson changed the title Fix issue #2563 Manipulation: Switch rnoInnerhtml to a version more performant in IE Sep 3, 2015
@markelog
Copy link
Member

markelog commented Sep 3, 2015

I have added additional detail to the commit message.

Could you add it beside the regexp itself? Otherwise we might forget that it is slow in Edge and remove it sometime in the future.

@mgol
Copy link
Member

mgol commented Sep 3, 2015

Could you add it beside the regexp itself? Otherwise we might forget that it is slow in Edge and remove it sometime in the future.

@SeanHenderson For reference, it should look something like that:

    // Support: IE 10-11, Edge 10240+
    // In IE/Edge using regex groups here causes severe slowdowns.
    // See https://connect.microsoft.com/IE/feedback/details/1736512/
    rnoInnerhtml = /<script|<style|<link/i,

Similar regular expressions exist but I didn't find one that will be used on large strings that might have the same kind of impact.

I'm not sure about that. The above rxhtmlTag regex is used in jQuery.htmlPrefilter which, in turn is used on most inputs to jQuery.fn.html. It seems this may be causing exactly the same slowdowns (although it would be good to perf-test it to make sure).

Maybe there are others?

SeanHenderson added a commit to SeanHenderson/jquery that referenced this pull request Sep 3, 2015
IE versions greater than 9 do not handle the old regular expression well with large html content
This is due to the use of a non-capturing group after a very common html character (<).

Test suite: http://jsfiddle.net/Lwa0t5rp/3/
Microsoft bug: https://connect.microsoft.com/IE/feedback/details/1736512/regular-expressions-are-slower-in-edge-than-in-ie8

Fixes jquerygh-2563
Closes jquerygh-2568
@SeanHenderson
Copy link
Contributor Author

Sigh, I work with TFS still getting used to GIT. I have created a new branch and a new pull request so I am closing off this one.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants