mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
The find_if lambdas in CustomElementRegistry and TraversableNavigable were taking GC::Root parameters, causing implicit conversion from GC::Ref (or copying of GC::Root) for each element visited. Each GC::Root creation/destruction allocates and frees a RootImpl, making linear scans over these vectors far more expensive than necessary. Use auto const& to match the actual vector element types. This was 2.3% of CPU time while opening a YouTube video.