After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 511893 - Live region performance enhancements
Live region performance enhancements
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Orca Maintainers
Orca Maintainers
Depends on:
Blocks: 423348
 
 
Reported: 2008-01-24 20:53 UTC by Scott Haeger
Modified: 2008-02-12 21:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first version of Live region performance enhancements (1.34 KB, patch)
2008-01-25 17:56 UTC, Scott Haeger
committed Details | Review

Description Scott Haeger 2008-01-24 20:53:58 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.
Comment 1 Scott Haeger 2008-01-25 17:56:19 UTC
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.
Comment 2 Willie Walker 2008-01-25 21:21:50 UTC
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!
Comment 3 Scott Haeger 2008-01-25 22:35:51 UTC
committed patch to trunk.  Bug to remain open until issue #2 is resolved.
Comment 4 Mike Pedersen 2008-01-28 14:20:56 UTC
This really does improve the performance on live region sites.  thanks much 
Comment 5 Scott Haeger 2008-02-12 21:11:25 UTC
marked as fixed.
Comment 6 Willie Walker 2008-02-12 21:48:23 UTC
(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.