Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 101166eb27a3be7d91f7cfda207aeddf4adb75de
      
https://github.com/WebKit/WebKit/commit/101166eb27a3be7d91f7cfda207aeddf4adb75de
  Author: Tyler Wilcock <[email protected]>
  Date:   2025-05-23 (Fri, 23 May 2025)

  Changed paths:
    M Source/WebCore/accessibility/AXTextRun.h
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp

  Log Message:
  -----------
  AX: Shrink size of AXTextRun from 56 bytes to 40 bytes and AXTextRuns from 32 
to 24 bytes by replacing Vector with FixedVector for member variables
https://bugs.webkit.org/show_bug.cgi?id=293463
rdar://151889539

Reviewed by Joshua Hoffman.

FixedVector is 8 bytes smaller than Vector, with the restriction being that it 
cannot be modified after being constructed.
The benefit is worth the restriction, since these are treated as immutable once 
cached in the isolated tree.

We did modify AXTextRun::characterAdvances after setting it in 
AccessibilityRenderObject::textRuns, so this commit re-orders
the code to avoid needing to do that.

This presumably saves ~7.9mb of memory on http://html.spec.whatwg.org (based on 
math alone, not actual `heap measurements`).

318911 instances of AXTextRuns * 8 bytes saved = 2.55mb
334589 instances of AXTextRun * 16 bytes saved = 5.35mb

* Source/WebCore/accessibility/AXTextRun.h:
(WebCore::AXTextRun::AXTextRun):
(WebCore::AXTextRun::domOffsets const):
(WebCore::AXTextRun::advances const):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textRuns):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to