Bug 114697 - Optimize OutputDevice to only call ImplRefreshAllFontData once after reading all embedded fonts
Summary: Optimize OutputDevice to only call ImplRefreshAllFontData once after reading ...
Status: RESOLVED DUPLICATE of bug 69060
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks:
 
Reported: 2017-12-26 11:43 UTC by Mike Kaganski
Modified: 2017-12-30 08:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2017-12-26 11:43:35 UTC
When opening documents with multiple embedded fonts, the operation takes much time (at least on Windows), the more fonts are installed on system - the longer.

To test, open attachment 117368 [details]. It contains multiple fonts, and its opening may take several minutes (>2 minutes on my system).

The problem is repeated call to OutputDevice::ImplRefreshAllFontData, that ends each OutputDevice::AddTempDevFont. The call executes OutputDevice::ImplRefreshFontData for all windows in application. It may take several seconds (I see 6 s on my system) each.

The proposal is to implement a way to avoid doing the expensive operations until all the fonts had been read. I see at least two ways to approach this:

1. Add a flag to ImplGetSVData()->maGDIData, that would tell OutputDevice::ImplRefreshAllFontData not to do anything; set in at the beginning of SaxExpatParser::parseStream (or another suitable function), and reset at the end (with refresh).

2. Reimplement the logic, so that invalidation would set a flag, and then any function that needs access to the data, would trigger the refresh and reset the flag.
Comment 1 Buovjaga 2017-12-26 19:35:03 UTC
Let's set to NEW.
Comment 2 Mike Kaganski 2017-12-27 22:02:01 UTC
A patch: https://gerrit.libreoffice.org/47112
Comment 3 Telesto 2017-12-28 08:16:39 UTC
bug 69060 comes to mind.. any relation?
Comment 4 Mike Kaganski 2017-12-28 10:24:40 UTC
(In reply to Telesto from comment #3)

Definitely. (Though I don't address the "save" part, as I don't see it; and I don't see discussion of "save" part in that bug either.)
I don't close this as duplicate, because I work on this, and if the patch would get accepted in its current form, it will reference this bug; but if I need to submit a new changeset, I'll change the bug # in the commit message, and close this as a dupe.
Comment 5 Mike Kaganski 2017-12-30 08:37:40 UTC

*** This bug has been marked as a duplicate of bug 69060 ***