GNOME Bugzilla – Bug 511893
Live region performance enhancements
Last modified: 2008-02-12 21:48:23 UTC
This bug is for tracking live region performance enhancements. Here are a couple issues that I am aware of. 1) Navigating a web page (eg. tabbing) is a bit sluggish when live region announcements are being made. I believe this is due to inefficiently re-entering the event queue in liveregions.pumpMessages(). Many callbacks to pumpMessages() fall through and are not acted upon when isSpeaking() returns True and there are messages in the live regions queue. A new strategy needs to be employed. 2) Moving to the last live region (key command 'y') may be out of sync with the announcement on very busy pages. This is a very tough problem because it is due to isSpeaking() returning False way too early. When this happens, a new message is sent out (and the associated object is cached) even though the current message has not finished.
Created attachment 103740 [details] [review] first version of Live region performance enhancements This patch addresses item #1 in the opening comment. The fix is two fold. First, I switched the gobject.idle_add() to a gobject.timeout_add(100ms). As mentioned in the opening comment, many callbacks to pumpMessages() fall through because isSpeaking() returns True. This change drastically reduces the number of callbacks to pumpMessages(), thus improving overall performance. The second change involves monitoring the last keyboard event in pumpMessages(). I believe this helps because of the dynamics involved in how the AT-SPI events come in and how they are serviced by the gobject event queue. Although I have no proof, I suspect the following is happening: 1) The user hits a key which triggers a keyboard event. 2) The keyboard event is serviced by the gobject event queue and the orca_state.lastInputEvent variable is set during this time and speech is stopped. 3) The gobject event queue services pumpMessages(), which outputs a message. 4) The caret moved or focus change event has come in and is now ready to be serviced by the gobject event queue. The result is a focus or caret moved event message being output. The problem is that the live region service comes before the focus/caret event service and the live region announcement is first. We prevent this from happening by monitoring the last input event.
I think this is a nice relatively low impact (as in code impact) fix and think it's safe to commit it. If anything, the only change I would make would be to allow the 100ms to be tunable. This could be as simple as making a constant such as "idleTime" at the top of the file -- someone could then "import orca.liveregions; orca.liveregions.idleTime=250" in their ~/.orca/orca-customizations.py file. But, this is not terribly important if you don't want to do it. Thanks!
committed patch to trunk. Bug to remain open until issue #2 is resolved.
This really does improve the performance on live region sites. thanks much
marked as fixed.
(In reply to comment #5) > marked as fixed. > (In reply to comment #3) > committed patch to trunk. Bug to remain open until issue #2 is resolved. Just for historical reference: we decided issue #2 was never going to get resolved, so we're not going to fix it.