[webkit-changes] [WebKit/WebKit] 12c97f: Shrink the size of ReportingObserver

Ryan Reno noreply at github.com
Mon Jan 20 09:27:57 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 12c97f7650721444b359ac0d0ab2e4d9b1599fda
      https://github.com/WebKit/WebKit/commit/12c97f7650721444b359ac0d0ab2e4d9b1599fda
  Author: Ryan Reno <rreno at apple.com>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M Source/WebCore/Modules/reporting/ReportingObserver.cpp
    M Source/WebCore/Modules/reporting/ReportingObserver.h
    R Source/WebCore/Modules/reporting/ReportingObserverOptions.idl

  Log Message:
  -----------
  Shrink the size of ReportingObserver
https://bugs.webkit.org/show_bug.cgi?id=286232
rdar://143206158

Reviewed by Anne van Kesteren.

In the spec ReportingObserverOptions contains a boolean and a
sequence<DOMString>. We had it implemented as an optional sequence which
took up extra space for std::optional bookkeeping. Before this patch
ReportingObserver was 104 bytes but with a 16 byte aligned allocator we
end up using 112 bytes. This shrinks the type down to 96 bytes by
storing a nullopt `types` array as an empty array in the ReportingObserver
C++ object.

* Source/WebCore/Modules/reporting/ReportingObserver.cpp:
(WebCore::ReportingObserver::ReportingObserver):
(WebCore::ReportingObserver::observe):
(WebCore::ReportingObserver::appendQueuedReportIfCorrectType):
* Source/WebCore/Modules/reporting/ReportingObserver.h:
* Source/WebCore/Modules/reporting/ReportingObserverOptions.idl: Removed.

Canonical link: https://commits.webkit.org/289153@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list