Getting nextSibling() will involve loading the first child into the register. Avoid that and just check m_firstChild and m_lastChild instead to avoid this extra memory load.
Created attachment 426070 [details] Patch
Comment on attachment 426070 [details] Patch If you say this is more efficient, I believe you. R=me. The new code definitely still is correct.
(In reply to Chris Dumez from comment #2) > Comment on attachment 426070 [details] > Patch > > If you say this is more efficient, I believe you. R=me. The new code > definitely still is correct. Yeah because m_firstChild and m_lastChild are both in the same object whereas m_firstChild isn't. CPU needs to load the content of m_firstChild and then retrieve m_nextSibling, which is an indirect load that CPU will have a hard time predicting so whilst prefetched would detect this and will fetch it, it can still result in either TLB hit miss and/or L2/L3 cache misses, which would be horrifyingly expensive.
Comment on attachment 426070 [details] Patch Clearing flags on attachment: 426070 Committed r275997 (236549@main): <https://commits.webkit.org/236549@main>
All reviewed patches have been landed. Closing bug.
<rdar://problem/76682121>