-
-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIA freezes after a large number of events is received #11002
Comments
Narrator seems to work as expected here, at least with my test case. |
Hmm, this might be related to other UIA performance issues. cc @bramd |
Users of Visual Studio are experiencing performance issues with
UIAutomation, too... And with Win10 native UI in general.
…--
Cuando tus fuerzas terminan, las de mi Dios comienzan.
|
I have the strong feeling that something @jcsteh wrote in #10508 (comment) is related to this:
I would say that a solution based on option 2 would have the least chance of regressions while having positive impact on performance. Now, I"m not sure what thread or threads handle all these events, as the log calls them dummy threads. However, if the UIA handler is processing an event and might be unable to process the next, if processing one event takes too much time without us discarding events that are out of date, things are slowing down. I think this is exactly what we're experiencing in several situations now, particularly in Visual Studio and may be in Word as well. |
yes, in most of the modern uia applications, nvda has serious
performance issues.
visual studio is a good example of this.
also skype is also infected, when openning new windows, nvda is silent
for several seconds.
jaws doesn't have such problems.
…On 4/21/20, Leonard de Ruijter ***@***.***> wrote:
I have the strong feeling that something @jcsteh wrote in
#10508 (comment) is
related to this:
> Obviously, not listening to property change events altogether isn't an
> option. However, Narrator and JAWS don't seem to be impacted like NVDA is.
> Some thoughts on that:
>
> 1. This is another reason to again consider selectively registering
> for property change events (e.g. on focus + ancestors and progress bar
> value changes), rather than unconditionally listening to all of them.
>
> 2. If I Register for property change events but return at the top of
> IUIAutomationPropertyChangedEventHandler_HandlePropertyChangedEvent (so we
> receive the event but discard it), it's pretty responsive. That suggests
> we might be able to optimise some of the stuff we do in the event handler;
> e.g. constructing the object, choosing overlay classes, etc.
I would say that a solution based on option 2 would have the least chance of
regressions while having positive impact on performance.
Now, I"m not sure what thread or threads handle all these events, as the log
calls them dummy threads. However, if the UIA handler is processing an event
and might be unable to process the next, if processing one event takes too
much time without us discarding events that are out of date, things are
slowing down. I think this is exactly what we're experiencing in several
situations now, particularly in Visual Studio and may be in Word as well.
Cc @michaelDCurran @josephsl @bramd
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#11002 (comment)
--
with best regards beqa
|
Related to #11077 |
At least for consoles, a lot of this appears to be a result of us registering for the Since consoles won't need these events any more once UIA notifications support is implemented for functional autoread, we should consider a way for NVDA not to register for these events from certain spammy providers, or only register for them in known-good cases. Thoughts @LeonarddeR, @michaelDCurran, @carlos-zamora? |
…tification events for now and preserve accessibility after UIA class name change (#13261) Link to issue number: Related to microsoft/terminal#12358 among others (to be released). Summary of the issue: In upcoming Windows Terminal and Windows Console, UIA notification events will be sent when new text is inserted (i.e. for text output) to improve Narrator support. This will result in double-reporting of all terminal output: once from LiveText and once from UIA notifications (but without appropriate filtering for typed characters/passwords etc). As part of the implementation of notifications, I asked Microsoft to change the UIA class name to allow new terminal support (including notifications) in a follow-up NVDA PR, since notifications will require a departure from the terminal strategy used by NVDA in the past. Changing the class name will break NVDA's current ability to identify the terminal and implement accessibility. Description of how this pull request fixes the issue: Suppress any received UIA notification events in UIA console and terminal for now, but log them for development. Support the new UIA class name used by terminals that send notifications. Ideally, NVDA would use these events in place of LiveText. If we could get away without registering for TextChange at all, this could be an extreme stability improvement in the terminal as #11002 would be completely circumvented. Also, having new text pushed to us (instead of having to diff) should improve performance considerably in high-volume scenarios.
Potentially related to #13334 |
Not quite, because Notepad on Windows 10 uses MSAA, not UIA. Notepad on Windows 11 is UIA based, and if this hang can be reproduced there it is caused by this issue. Similar issues in VS, Windows Terminal, and (UIA) console are also in scope. |
Link to issue number: Partial mitigation for #11002. Follow-up of #11214 and #13297. Summary of the issue: NVDA 2020.3 introduced support for selective registration for UIA events based on the currently-focused provider, but this is disabled by default due to bugs in the Windows 10 task manager and emoji panel. These bugs have been fixed in Windows 11 SV2. Description of how this pull request fixes the issue: By default, enable selective UIA event registration on Windows 11 Sun Valley 2 (22H2). Testing strategy: Enable by default in master snapshots to allow for wider testing.
Further investigation is required of course, but I think something along the lines of #10556 for UIA events would go a very long way here. |
…Windows Terminal (#14067) Mitigation for #11002. Blocking #14047. Summary of the issue: UIA textChange NVDA events are seldom (if ever) used outside of a few specific situations, but have an extreme performance impact (see #11002). Description of user facing changes Improved performance/less chance of NVDA hanging in UIA applications. Description of development approach Explicitly do not process UIA textChange events outside of Windows Console, Terminal, and Word. The eventual end goal is to remove TermControl/TermControl2 from UIAHandler.textChangeUIAClassNames in #14047, which will very greatly improve performance in Windows Terminal. (conhost will remain, as there don't seem to be any plans to add notifications, especially as wt is becoming the default). I'm very reluctant to add a mechanism by which add-ons/app modules can request textChange events unless someone requests it, especially given #11002.
This has been probably fixed by #14888. Closing as fixed, but feel free to comment in case the issue still exists in the last NVDA alpha version and we can reopen. @LeonarddeR now that #14888 is merged, is selective registering for UIA events still needed at all? You implemented that in #11214. |
Yes, I think so. It generally doesn't make sense to register to events you don't need. |
Steps to reproduce:
Enable "use UI Automation to access the Windows Console" from advanced preferences.
Run
cmd
.Start a python interpreter:
python
.Run:
for i in range(100000):
print("test")
Actual behavior:
"test" is read for a few seconds, then all UIA applications become completely inaccessible until NVDA is restarted.
Expected behavior:
Output stops for a few seconds, then UIA recovers.
Context
I also tried disabling UIA connection recovery and event coalescing with the following in the NVDA Python console:
After UIA dies, running
uiaHandler.terminate()
andUIAHandler.initialize()
does not restart UIA functionality. I'm not sure how to detect when UIA breaks or how to restart it once it does.System configuration
NVDA installed/portable/running from source:
Installed and source.
NVDA version:
Latest master (b38776a).
Windows version:
Windows 10 21H1 insider.
Name and version of other software in use when reproducing the issue:
Windows Console
Other information about your system:
Other questions
Does the issue still occur after restarting your computer?
Yes.
Have you tried any other versions of NVDA? If so, please report their behaviors.
2019.2.1, 2019.3, 2020.1 (all same result).
If addons are disabled, is your problem still occuring?
Yes.
Did you try to run the COM registry fixing tool in NVDA menu / tools?
Not applicable.
The text was updated successfully, but these errors were encountered: