Bug 93933 - Accessibility event "flood" and lag when opening certain large Writer documents
Summary: Accessibility event "flood" and lag when opening certain large Writer documents
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.2.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords: accessibility, perf
Depends on:
Blocks: a11y-Linux
  Show dependency treegraph
 
Reported: 2015-09-05 02:24 UTC by Joanmarie Diggs
Modified: 2016-09-02 10:37 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test case: laggy.odt (175.60 KB, application/vnd.oasis.opendocument.text)
2015-09-05 02:24 UTC, Joanmarie Diggs
Details
accessible-event listener: soffice-events.py (532 bytes, text/x-python)
2015-09-05 02:29 UTC, Joanmarie Diggs
Details
Log output from performing the steps in the opening report (292.47 KB, text/plain)
2015-09-05 02:43 UTC, Joanmarie Diggs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joanmarie Diggs 2015-09-05 02:24:57 UTC
Created attachment 118423 [details]
Test case: laggy.odt

Steps to reproduce:
1. Launch the (to-be) attached accessible-event listener in a terminal
2. Open the attached test case (you may wish to do so via CLI and --norestore)
3. Do not interact with your system, the document or anything just wait

Expected results: The act of merely opening the document would not result in 3000-4000 accessible events logged in the terminal.

Actual results: 3000-4000 accessible events are emitted and logged. In addition, it takes multiple seconds (for this doc, it averages 10. The doc it's based on* averages 15).

*The original document was shared privately by an Orca user to me. At this time he does not have permission to make the document public. However, there is *something* about that document that makes the flood and delay significantly worse compared to documents of similar size and formatting. In order to file this bug, I took the original document and replaced all the characters, the URLs, the image, the bookmarks, etc., etc., etc. In doing so, I created something that demonstrates the problem well enough. If we can get permission to share the original, we'll attach it here.
Comment 1 Joanmarie Diggs 2015-09-05 02:29:08 UTC
Created attachment 118424 [details]
accessible-event listener: soffice-events.py

As you'll see, all this event listener does is print the received "object" events emitted by LibreOffice. It does no other processing -- a screen reader, on the other hand, does more processing. Thus the 10-15 second delay and associated app and system lag reported here is actually much worse for end users of assistive technologies like Orca.
Comment 2 Joanmarie Diggs 2015-09-05 02:43:45 UTC
Created attachment 118425 [details]
Log output from performing the steps in the opening report

Note that there around 4000 accessible events from LibreOffice just from opening the document. Some things worth noting:

1. The first event is for the window (frame) becoming active (21:01:36)

2. The event that indicates the frame has the name of the document is 11 seconds later (see line 1433)

3. Most of the events are emitted for objects whose accessible role is paragraph.

4. There are quite a lot of (by which I mean excessive) events for:
   a. object:state-changed:showing
   b. object:visible-data-changed
   c. object:text-changed:insert
   d. object:text-changed:delete
   e. object:text-attributes-changed

It might be worth considering (by which I mean please DO consider) NOT emitting signals for text changes that result from the loading of the document. From the point of view of the user (and his/her screen reader), no text was inserted or removed from those paragraphs. Similarly, the text in those paragraphs didn't change attributes. All the user did was open the document which already had the text and attributes in question.

5. There are a number of "[DEAD]" accessibles. It's not clear to me if those objects are still in the process of being created or went defunct as a result of a timeout. But there's only 177 of them (out of the ~4000 total).
Comment 3 Joanmarie Diggs 2015-09-05 02:49:55 UTC
Adding Jamie to the CC list. Do you get bombarded with event floods from the attached document, or is this some weird platform issue? (Thanks in advance for trying!)
Comment 4 Buovjaga 2016-04-27 13:32:48 UTC
(In reply to Joanmarie Diggs from comment #0)
> Created attachment 118423 [details]
> Test case: laggy.odt
> 
> Steps to reproduce:
> 1. Launch the (to-be) attached accessible-event listener in a terminal
> 2. Open the attached test case (you may wish to do so via CLI and
> --norestore)
> 3. Do not interact with your system, the document or anything just wait

Should it attach automatically to soffice? It didn't print any events at all for me.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha1+
Build ID: 334599030e7b45153107a3075f9049a7463aac80
CPU Threads: 8; OS Version: Linux 4.5; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on April 22nd 2016

On Arch the dependency package is: python-atspi
Comment 5 Alex ARNAUD 2016-05-03 14:48:31 UTC
(In reply to Buovjaga from comment #4)
> (In reply to Joanmarie Diggs from comment #0)
> > Created attachment 118423 [details]
> > Test case: laggy.odt
> > 
> > Steps to reproduce:
> > 1. Launch the (to-be) attached accessible-event listener in a terminal
> > 2. Open the attached test case (you may wish to do so via CLI and
> > --norestore)
> > 3. Do not interact with your system, the document or anything just wait
> 
> Should it attach automatically to soffice? It didn't print any events at all
> for me.

Dear Buovjaga, on Debian 8.4 with LibreOffice 5.1.2 I can reproduce the issue.
Are you using LibreOffice GTK version ?

Best regards.
Comment 6 Buovjaga 2016-05-05 16:44:55 UTC
Yep, it was my ignorance about GTK requirement. Launched with SAL_USE_VCLPLUGIN=gtk3 and could reproduce.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha1+
Build ID: 540fee2dc7553152914f7f1d8a41921e765087ef
CPU Threads: 8; OS Version: Linux 4.5; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on April 30th 2016