Title: [169047] trunk/Source/WebCore
Revision
169047
Author
[email protected]
Date
2014-05-19 09:10:54 -0700 (Mon, 19 May 2014)

Log Message

AX: iOS: using AXAttributeCacheEnabler is too slow for every accessibilityElementAtIndex:
https://bugs.webkit.org/show_bug.cgi?id=133043

Reviewed by Mario Sanchez Prada.

iOS Accessibility code tries to improve performance by caching attributes when accessing
elements through the platform API. However, those API calls can be used very frequently when 
iterating elements. Creating the AXAttributeCacheEnabler object and tearing it down is proving
to be the hottest code path in samples for accessibility access.

We need to move the logic for enabling/disabling the attribute cache to a level that can make
a more informed decision about when to enable/disable.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper enableAttributeCaching]):
(-[WebAccessibilityObjectWrapper disableAttributeCaching]):
(-[WebAccessibilityObjectWrapper accessibilityElementCount]):
(-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
(-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169046 => 169047)


--- trunk/Source/WebCore/ChangeLog	2014-05-19 15:53:37 UTC (rev 169046)
+++ trunk/Source/WebCore/ChangeLog	2014-05-19 16:10:54 UTC (rev 169047)
@@ -1,3 +1,25 @@
+2014-05-18  Chris Fleizach  <[email protected]>
+
+        AX: iOS: using AXAttributeCacheEnabler is too slow for every accessibilityElementAtIndex:
+        https://bugs.webkit.org/show_bug.cgi?id=133043
+
+        Reviewed by Mario Sanchez Prada.
+
+        iOS Accessibility code tries to improve performance by caching attributes when accessing
+        elements through the platform API. However, those API calls can be used very frequently when 
+        iterating elements. Creating the AXAttributeCacheEnabler object and tearing it down is proving
+        to be the hottest code path in samples for accessibility access.
+
+        We need to move the logic for enabling/disabling the attribute cache to a level that can make
+        a more informed decision about when to enable/disable.
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper enableAttributeCaching]):
+        (-[WebAccessibilityObjectWrapper disableAttributeCaching]):
+        (-[WebAccessibilityObjectWrapper accessibilityElementCount]):
+        (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
+        (-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]):
+
 2014-05-18  Simon Fraser  <[email protected]>
 
         Use RenderStyle& in more places in RenderLayerBacking

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (169046 => 169047)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2014-05-19 15:53:37 UTC (rev 169046)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2014-05-19 16:10:54 UTC (rev 169047)
@@ -341,12 +341,23 @@
     return AccessibilityUnignoredAncestor(axObject->wrapper());    
 }
 
+- (void)enableAttributeCaching
+{
+    if (AXObjectCache* cache = m_object->axObjectCache())
+        cache->startCachingComputedObjectAttributesUntilTreeMutates();
+}
+
+- (void)disableAttributeCaching
+{
+    if (AXObjectCache* cache = m_object->axObjectCache())
+        cache->stopCachingComputedObjectAttributes();
+}
+
 - (NSInteger)accessibilityElementCount
 {
     if (![self _prepareAccessibilityCall])
         return 0;
 
-    AXAttributeCacheEnabler enableCache(m_object->axObjectCache());
     if ([self isAttachment])
         return [[self attachmentView] accessibilityElementCount];
     
@@ -358,7 +369,6 @@
     if (![self _prepareAccessibilityCall])
         return nil;
 
-    AXAttributeCacheEnabler enableCache(m_object->axObjectCache());
     if ([self isAttachment])
         return [[self attachmentView] accessibilityElementAtIndex:index];
     
@@ -378,7 +388,6 @@
     if (![self _prepareAccessibilityCall])
         return NSNotFound;
     
-    AXAttributeCacheEnabler enableCache(m_object->axObjectCache());
     if ([self isAttachment])
         return [[self attachmentView] indexOfAccessibilityElement:element];
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to