https://bugs.documentfoundation.org/show_bug.cgi?id=117636

Jonathan Clark <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|[email protected] |[email protected]
                   |desktop.org                 |

--- Comment #18 from Jonathan Clark <[email protected]> ---
The root cause is the structure of the document itself. That large block of
hanzi at the end isn't so simple: it's broken up into thousands of tiny spans.

The formatting looks something like this:

> Style sets language to en-US
> 2-6 character run
> DF sets language to en-US
> 2-6 character run
> DF unsets language
> 2-6 character run
> DF sets language to en-US
> 2-6 character run
> DF unsets language
> ... (repeat thousands of times)

The structure isn't exactly like this, but that's the general idea. There's a
checkerboard of direct formatting which doesn't affect document semantics, but
differs just enough from span to span that we don't treat it as contiguous
text. Combine this with a tiny font size that puts all of these spans on screen
at the same time, and we naturally get the observed performance
characteristics.

Metadata suggests this document may have been generated by Kingsoft Office/WPS
Office. Word doesn't seem to produce documents like this. If you re-save this
document in Word, all of the unnecessary language DF is automatically stripped
from the file (and the bug no longer reproduces).

I created a candidate patch which adds the same performance optimization to
Writer. Repeating the PDF export test from comment 17 gives the following
results:

real    0m12.265s
user    0m10.078s
sys     0m0.202s

Within the UI, the performance difference feels larger. Previously, trying to
view or scroll on the last page would freeze on my machine for around 10
seconds. With the patch, scrolling on the last page now feels the same as the
rest of the document.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to