| Summary: | Avoid indirect load in ContainerNode::hasOneChild() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
| Component: | DOM | Assignee: | Ryosuke Niwa <rniwa> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cdumez, darin, esprehn+autocc, ews-watchlist, kangil.han, webkit-bug-importer, ysuzuki | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Ryosuke Niwa
2021-04-14 19:16:46 PDT
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. |