Gecko_ia2 virtualBuffer's isAlive property: provide a roughly 14x speed-up, greatly reducing the lag seen when 10s of tabs are open in Firefox or chrome #7443
Merged
Conversation
…ed-up by no longer calling AccessibleObjectFromevent, and calling IAccessible2::States directly to check for defunct. A COMError when calling IAccessible2::States (such as with Chrome) is treated as the object also being defunct as it is truely dead or disconnected.
feerrenrut
approved these changes
Jul 26, 2017
Collaborator
|
shouldn't this be a 4x speed up, in the whats new instead of a 1/4x speedup? |
Member
Author
|
Where does it say 1/4? It should actually be 14. |
Collaborator
|
Oh, I sware the title was 1/4 speed up Lol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #3138
Summary of the issue:
On every focus change, NVDA runs
treeInterceptorHandler.cleanup()in order to kill off any dead virtualBuffers left from no longer existing documents. Gecko_ia2 virtualBuffer's isAlive property called AccessibleObjectFromEvent as one of the ways to validate if the document still existed. However, calling this many times can be very slow, and could produce a major lag on a system with 10s of tabs open in Firefox or Chrome. This call is no longer necessary these days as we can detect this by checking if the root object has the defunct state, or its properties no longer work.Description of how this pull request fixes the issue:
The call to AccessibleObjectFromEvent has been removed. Also, rather than using the states property on the NVDAObject to check for defaunct, use the raw IAccessible2::States property instead. This is more direct and much faster, plus we can also catch any possible COMError and treat this the same as if defunct was there.
Note that Chrome currently produces a COMError when calling IAccessible2::states when dealing with an object for a document that has closed, rather than still supporting IA2_STATE_DEFUNCT.
Testing performed:
In both Firefox and Chrome:
Change log entry:
Bug fixes: