Bug 133043 - AX: iOS: using AXAttributeCacheEnabler is too slow for every accessibilityElementAtIndex:
Summary: AX: iOS: using AXAttributeCacheEnabler is too slow for every accessibilityEle...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-17 23:42 PDT by chris fleizach
Modified: 2014-05-19 09:31 PDT (History)
9 users (show)

See Also:


Attachments
patch (2.97 KB, patch)
2014-05-17 23:52 PDT, chris fleizach
mario: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2014-05-17 23:42:52 PDT
On iOS, the attribute cache enabler is being used on every access to elementAtIndex. 
Sample shows that we're spending a lot of time creating and tearing down these objects. 

I think we need to provide the ability to enable and disable caching at a higher, more informed level, so that we can cut down on these costs.


<rdar://problem/16945180>
Comment 1 chris fleizach 2014-05-17 23:52:28 PDT
Created attachment 231650 [details]
patch
Comment 2 Anders Carlsson 2014-05-18 07:23:23 PDT
Comment on attachment 231650 [details]
patch

Who calls enableAttributeCaching and disableAttributeCaching, the OS?
Comment 3 chris fleizach 2014-05-18 07:48:10 PDT
(In reply to comment #2)
> (From update of attachment 231650 [details])
> Who calls enableAttributeCaching and disableAttributeCaching, the OS?

The accessibility framework that is on the app side knows when a list of elements  is requested. That framework is able to start and stop the cache for us
Comment 4 Mario Sanchez Prada 2014-05-19 05:48:40 PDT
Comment on attachment 231650 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231650&action=review

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:346
> +    m_object->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMutates();

Perhaps you want to check whether axObjectCache() returns null here before using it?

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:351
> +    m_object->axObjectCache()->stopCachingComputedObjectAttributes();

Same comment here
Comment 5 chris fleizach 2014-05-19 09:11:35 PDT
(In reply to comment #4)
> (From update of attachment 231650 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=231650&action=review
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:346
> > +    m_object->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMutates();
> 
> Perhaps you want to check whether axObjectCache() returns null here before using it?
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:351
> > +    m_object->axObjectCache()->stopCachingComputedObjectAttributes();
> 
> Same comment here

Done.

Thanks

http://trac.webkit.org/changeset/169047