RESOLVED FIXED312803
API::PageConfiguration::Data::LazyInitializedRef wastefully initializes unneeded objects
https://bugs.webkit.org/show_bug.cgi?id=312803
Summary API::PageConfiguration::Data::LazyInitializedRef wastefully initializes unnee...
Brent Fulgham
Reported 2026-04-20 13:10:06 PDT
The copy assignment operator for Data::LazyInitializedRef (APIPageConfiguration.h (Line 504:)) triggers an initialization by calling `get()` on the source object: void operator=(const LazyInitializedRef& other) { m_value = other.get(); } This triggers lazy initialization on the source `m_value` for ANY uninitialized member. During `copyDataFrom`, the Data struct's generated copy assignment calls this for ALL 5 LazyInitializedRef members. For members NOT explicitly set on the source (e.g., visitedLinkStore, defaultWebsitePolicies), this causes us to create throw-away objects as a side-effect of copying. While this doesn't create any user-facing bug, it does involve allocating/deallocating up to 5 objects for each copy (e.g., during IPC) which uses power and costs us performance.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-20 13:10:23 PDT
Brent Fulgham
Comment 2 2026-04-20 14:13:47 PDT
EWS
Comment 3 2026-04-27 13:42:56 PDT
Committed 312140@main (f84460ba474e): <https://commits.webkit.org/312140@main> Reviewed commits have been landed. Closing PR #63153 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.