Bug 88518 - FILEOPEN RTF: PDF export speeds up document build times significantly
Summary: FILEOPEN RTF: PDF export speeds up document build times significantly
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-16 23:38 UTC by Sascha Fichtner
Modified: 2015-01-17 16:01 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple but huge repro file. (1.55 MB, application/rtf)
2015-01-16 23:38 UTC, Sascha Fichtner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Fichtner 2015-01-16 23:38:39 UTC
Created attachment 112370 [details]
Simple but huge repro file.

Some general remarks:
First off, sorry for the huge attachement but to really see what this bug report is about we need a huge document that takes a while to load. All timings mentioned here were taken on Windows 7 running on an Intel Core 2 Duo E8400 clocked at 2GHz. So if your machine is faster or slower your mileage may vary. :)
To be able to properly repro the issue I decided to use a document fairly similar to the real life document I am working on, but with the original text replaced by the "Lorem ipsum" text.
What I call "build & display" is what I assume LibreWriter does once it has finished loading the RTF file (the document's first page is now visible) and has started parsing its content, building the document structure from it and displaying what has been built already. Once this "build & display" process ends, the document with all of its pages is fully displayed in LibreWriter.

Problem description: 
While the attached RTF file takes a significant time to fully "build & display" all of its content in LibreWriter, immediately (after loading has finished) starting an export to PDF will speed up this "build & display" time for the document tremendously.

Steps to reproduce:
- Load the attached .rtf file.
- Measure the time it takes for all ~267 pages to build and display.
- Close the document.
- Load the attached .rtf file again.
- Start measuring the time again.
- Immediately after loading has finished (and "building and displaying" has started) select File > Export as PDF, hit Export and save to some random location.
- Once exporting the PDF has finished, the document will also have finished "building and displaying" all ~267 pages.
- Stop measuring the time.

Current behavior:
Building and displaying the document without doing anything takes ~75 seconds on my machine.
Building and displaying the document while exporting it as PDF at the same time takes ~16 seconds on my machine.

Expected behavior:
Building and displaying the document without doing anything should not take longer than it takes when exporting the PDF at the same time.
Comment 1 Robinson Tryon (qubit) 2015-01-17 00:42:17 UTC
Comment on attachment 112370 [details]
Simple but huge repro file.

fix mimetype
Comment 2 David Tardon 2015-01-17 09:39:11 UTC
Pagination of a loaded document happens on background, with a very low priority (except for the current page, of course), on the assumption that the pages do not have to be available immadiately. Obviously, all pages are needed on PDF export, so the pagination is finished immediately. You can use Tools->Update->Page Formatting to cause an immediate re-pagination at any time.
Comment 3 Sascha Fichtner 2015-01-17 16:01:36 UTC
Thanks a lot for the tip. This indeed solves my/this issue! :)