[webkit-changes] [WebKit/WebKit] 4f22ef: AX: AXCoreObject::roleValue() should be made non-v...
Tyler Wilcock
noreply at github.com
Sat Dec 21 14:39:05 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4f22effe60d640611ef0603110004c83defa8a4d
https://github.com/WebKit/WebKit/commit/4f22effe60d640611ef0603110004c83defa8a4d
Author: Tyler Wilcock <tyler_w at apple.com>
Date: 2024-12-21 (Sat, 21 Dec 2024)
Changed paths:
M Source/WebCore/accessibility/AXCoreObject.h
M Source/WebCore/accessibility/AXLogger.cpp
M Source/WebCore/accessibility/AccessibilityObject.h
M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
Log Message:
-----------
AX: AXCoreObject::roleValue() should be made non-virtual
https://bugs.webkit.org/show_bug.cgi?id=285067
rdar://141874370
Reviewed by Chris Fleizach.
roleValue() is one of our most commonly called functions, and it being virtual prevents the compiler from inlining it,
preventing other optimizations. With this commit, AccessibilityObject::m_role is moved to AXCoreObject::m_role.
For AXIsolatedObjects, we used to store role as AXPropertyName::RoleValue. This was wasteful in terms of memory, as
every entry in the property map is the size of the largest type in AXPropertyValueVariant, which is currently 32 bytes,
while AccessibilityRole is only 1 byte. By moving role to AXCoreObject::m_role instead of storing it as a property,
we save 31 bytes per object. This saves 17.6mb on http://html.spec.whatwg.org (567769 objects times 31 bytes).
* Source/WebCore/accessibility/AXCoreObject.h:
(WebCore::AXCoreObject::roleValue const):
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::AXIsolatedObject):
(WebCore::AXIsolatedObject::initializeProperties):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
Canonical link: https://commits.webkit.org/288224@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