[webkit-changes] [WebKit/WebKit] 8a06d3: AX: AXIsolatedObject::m_propertyMap is not sparse
Joshua Hoffman
noreply at github.com
Tue Sep 26 07:07:02 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8a06d352a4ab1206a339458a225a90a5927564f9
https://github.com/WebKit/WebKit/commit/8a06d352a4ab1206a339458a225a90a5927564f9
Author: Joshua Hoffman <jhoffman23 at apple.com>
Date: 2023-09-26 (Tue, 26 Sep 2023)
Changed paths:
M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
Log Message:
-----------
AX: AXIsolatedObject::m_propertyMap is not sparse
https://bugs.webkit.org/show_bug.cgi?id=261968
rdar://115907545
Reviewed by Andres Gonzalez.
This patch makes the AXIsolatedObject::m_propertyMap, where AXIsolatedObject properties are cached,
sparse. This is accomplished through conditionally adding properties to the map, based on whether
their values are the default for their given type. If a value is the default, we don't add it to
the map (or if it changes to be the default, we remove it). Our existing logic handles these cases
by returning the type's default value when it does not exist in the property map.
The initial size allocation for the propertyMap was brought down to 22 from 92 after running
this change on several sites and finding the minimum number of properties stored.
With this patch applied, on average it reduces the memory footprint of the web process (with AX
enabled) by ~33%. This analysis was performed using VoiceOver on an academic journal page.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::AXIsolatedObject):
(WebCore::AXIsolatedObject::setProperty):
(WebCore::AXIsolatedObject::indexRangePairAttributeValue const):
(WebCore::AXIsolatedObject::pairAttributeValue const): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
Canonical link: https://commits.webkit.org/268449@main
More information about the webkit-changes
mailing list