Hi Team, Usually reducing expensive calls are always better, so I just wanted to raise and get input whether we can do similar to improve performance or reach to similar idea: Blink Commit - https://chromium.googlesource.com/chromium/blink/+/ea1156d6f005f978e4da707ef4e2060c2fc7151f WebKit GitHub - https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/GraphicsLayer.cpp#316 & https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/GraphicsLayer.cpp#395 Just wanted to raise so if it is something worth implementing with the same idea, we can gain some performance point. Thanks!
<rdar://problem/104534645>
This compiles: void GraphicsLayer::removeAllChildren() { while (!m_children.isEmpty()) { auto curLayer = m_children.last(); ... _______________ NOTE - It seems 'removeFromParent' calls 'removeFromParentInternal()' and it seems to be using 'removeFirstMatching' rather than 'reverseFind' but don't know how to amend this part. void GraphicsLayer::removeFromParentInternal() { if (m_parent) { GraphicsLayer* parent = m_parent; setParent(nullptr); parent->m_children.removeFirstMatching([this](auto& layer) { return layer.ptr() == this; }); // |this| may be destroyed here. } } ______________
Pull request: https://github.com/WebKit/WebKit/pull/18578
Committed 268814@main (106c4aae5f43): <https://commits.webkit.org/268814@main> Reviewed commits have been landed. Closing PR #18578 and removing active labels.