Element.firstElementChild, Element.lastElementChild, Element.previousElementSibling, Element.nextElementSibling and Node.parentElement of V8 are much slower than JSC. We should optimize them. The results of the attached performance tests are as follows in my local Mac environment : AppleWebKit/Safari: div.firstElementChild : 1162ms div.lastElementChild : 1016ms div.previousElementSibling : 918ms div.nextElementSibling : 900ms div.parentElement : 901ms Chromium/V8: div.firstElementChild : 9515ms div.lastElementChild : 9449ms div.previousElementSibling : 9254ms div.nextElementSibling : 9315ms div.parentElement : 9380ms
Created attachment 130594 [details] Performance tests
Created attachment 130595 [details] Patch
Comment on attachment 130595 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130595&action=review > Source/WebCore/ChangeLog:11 > + This patch improves the performance of Element.firstElementChild by 5.8 times, > + Element.lastElementChild by 6.2 times, Element.previousElementSibling by 7.1 times, > + Element.nextElementSibling by 7.1 times, and Node.parentElement by 6.7 times. Wow
Comment on attachment 130595 [details] Patch Clearing flags on attachment: 130595 Committed r110106: <http://trac.webkit.org/changeset/110106>
All reviewed patches have been landed. Closing bug.