Based on @dmethvin idea.
By opening this PR, i want, one way or another, to close #10515, but i'm not sure what a resolution of that ticket should be.
This is a difference between iAH methods and current DOM-manipulation tactics –
In some situations insertAdjacentHTML method could not be applied, guards for that cases will slow down jQuery#domManip method –
Performance ratio of WebKit iAH in case of big HTML-string relative to current DOM-manipulation way is utterly depressing, one might even suggest that this happens due to regexp check, but it's not the case – in that version of a iAH implementation regexp check is removed, which does not heavily change the picture. Solution for that problem might be size check of HTML-string.
Use of jQuery#append as an example of that idea – big/small HTML-string. This control is flatten disproportion in WebKit case, but it also decrease performance in other browsers.
I suppose big HTML-string is rarely acts as argument in jQuery's DOM-manipulation methods, maybe only in case when whole page should be reflowed, besides, 184 operation per second might be fast enough for that task, ergo it might be more productive to dwell on more optimistic small HTML-string's cases, given the idea that if whether or not iAH should be employed was made only by proceeding outcome most of other samples then decision would be little more obvious? As of perf hit examples (see above) – some of them are rare edge cases, some of them do not matter that much and some of them aren't that conclusive.
But considering all that, i'd say this research is showed a lot of arguments to not use iAH inside of jQuery#domManip at all.
Fixes #10515 - Implementation of iAH
Great analysis here! I have to agree that given your research it seems like the payback isn't that great, there's no reason to complicate the code. Anyone have other thoughts about it?
I agree too. We're just covering so much more functionality (and working around so many edge cases) that iAH doesn't seem worth the complexity as it stands, let alone once people start filing bugs against it.
If anyone does find our DOM manipulation to be a bottleneck, ey're probably better off going all the way down to native methods than taking advantage of a thin wrapper anyway.
👍 Reference this pull in the ticket when closing.
http://bugs.jquery.com/ticket/10515 you are well and truly closed!