html() uses a regular expression that performs badly in IE > 9 #2563
Labels
Milestone
Comments
|
Thanks for the report! I confirmed this is very slow in Edge (build 10240). Would you like to submit a PR to take the credit for the perf fix? |
|
#2568 Not sure if this is done correctly / if this should also go in other branches as well |
SeanHenderson
added a commit
to SeanHenderson/jquery
that referenced
this issue
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
added a commit
to SeanHenderson/jquery
that referenced
this issue
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-2574
mgol
added a commit
that referenced
this issue
Sep 8, 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/ (cherry-picked from d4def22) Fixes gh-2563 Closes gh-2574
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
rnoInnerhtml = /<(?:script|style|link)/i
The above causes significant performance issues in IE 10 IE 11 and EDGE when inserting large amounts of HTML using the html function.
It can be re-written as the following:
rnoInnerhtml = /<script|<style|<link/i,
The above performs at the same level in other browsers and exponentially faster in IE .
My tests show for two columns for 4096 rows the difference is 18 seconds versus 5 milliseconds (IE 11).
http://jsfiddle.net/Lwa0t5rp/3/
Note when testing you the first test will always be slower than the second in chrome / firefox
Ticket logged at Microsoft however i think jQuery should be fixed anyways.
https://connect.microsoft.com/IE/feedback/details/1736512/regular-expressions-are-slower-in-edge-than-in-ie8
The text was updated successfully, but these errors were encountered: