Bug 141415 - DOC: FILEOPEN: Very slow document opening (2-5min instead of 20sec)
Summary: DOC: FILEOPEN: Very slow document opening (2-5min instead of 20sec)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.1.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0
Keywords: filter:doc, haveBacktrace, perf
Depends on:
Blocks: DOC-Opening
  Show dependency treegraph
 
Reported: 2021-04-01 07:04 UTC by Igor D.
Modified: 2025-03-23 12:45 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
DOC format (1.79 MB, application/msword)
2021-04-01 07:06 UTC, Igor D.
Details
DOCX format (215.16 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-04-01 07:06 UTC, Igor D.
Details
ODT format (109.60 KB, application/vnd.oasis.opendocument.text)
2021-04-01 07:06 UTC, Igor D.
Details
Perf flamegraph of ODT opening (6.30 MB, image/svg+xml)
2024-10-08 15:33 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor D. 2021-04-01 07:04:34 UTC
Description:
Very slow openning document (from 1 m 50 sec to 5m) in comparison to MS Word 2016 (about 20 sec).

Examlpe of the file in attachments in different formats.

Original file was in DOC format (when I expirience problem), but for providing more information I converted it to ODT and DOCX and tested it also. And seems ODT have additional problem (much slower).

My OS - Windows 8.1 x64, RAM - 16Gb , CPU - Xeon E5-2440 v2 1.9GHz
LibreOffice 7.1.1.2


Steps to Reproduce:
1. Open LibreOffice  Writer.
2. Use "File->Open" to open example file and count a time until document becomes visible and editable.
3. Open MS Office 2016 (or newer)
4. Select and open example file and scroll down vertical slider to the end of the document once fist page is loaded. Count a time until the last page appears and document bocomes editable.


Actual Results:
------------
sppfd249.doc 
LibreOffice 7.1.1.2 - 1m 50s
MS Office 2016 - 20sec
--------------
sppfd249.odt
LibreOffice 7.1.1.2 - 5m 10s (first page - 10s, stops UI stucking/freezing - 5m 10s; 50% CPU usage)
MS Office 2016 - 25sec
--------------
sppfd249.docx
LibreOffice 7.1.1.2 - 2m 30s (first page - 40s, stops UI stucking/freezing - 2m 30s), 50% CPU usage
MS Office 2016 - 20sec

Expected Results:
------------
sppfd249.doc 
LibreOffice 7.1.1.2 - 20sec-30sec

--------------
sppfd249.odt
LibreOffice 7.1.1.2 - 20sec-30sec

--------------
sppfd249.docx 
LibreOffice 7.1.1.2 - 20sec-30sec



Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.1.2 (x64) / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 16; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded
Comment 1 Igor D. 2021-04-01 07:06:09 UTC
Created attachment 170883 [details]
DOC format
Comment 2 Igor D. 2021-04-01 07:06:35 UTC
Created attachment 170884 [details]
DOCX format
Comment 3 Igor D. 2021-04-01 07:06:52 UTC
Created attachment 170885 [details]
ODT format
Comment 4 Michael Warner 2021-04-01 13:01:53 UTC
FYI, no repro in:

Version: 7.0.4.2 (x64)
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

I haven't tried it in 7.1.1.2 but at least there's a lower bound on any bibisect.
Comment 5 Roman Kuznetsov 2021-04-01 14:15:18 UTC
confirm in

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 78c33a4c3d1633b97049874305b3b49b820395a2
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

it took 1 min 50 sec

but in

Версия: 6.2.4.2
ID сборки: 2412653d852ce75f65fbfa83fb7e7b669a126d64
Потоков ЦП: 4; ОС:Windows 10.0; Отрисовка ИП: по умолчанию; VCL: win; 
Локаль: ru-RU (ru_RU); Язык UI: ru-RU
Calc: threaded

it took 1 min 10 sec

and finally it took only 9 sec in MSO 2016
Comment 6 Igor D. 2021-09-20 03:38:20 UTC
Please, pay attension on this bug
Comment 7 Roman Kuznetsov 2021-09-20 08:13:35 UTC
Doc opening took 30 sec in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 80a47aae1419842f4496f02028e2b49763aea25b
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 8 Igor D. 2021-09-23 06:20:06 UTC
Please take into account - I assume that document opening is finished, when you can scroll down it to the end and can print something without freezing.

BTW - look at CPU utilization while opening. 
One of the cores utilized to 100%. Good alternative reference point to count a time.


My results on 7.3.0.0.alpha0+ (x64)

DOC - 1m 10s 
ODT - 3m 50s (firts page after 10s but freezing  freezing freezing up to 3m 50s)
DOCX - 1m 20s 

Problem is still here I think. 
And comparison to MS Office time still not good.


Please check.


Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: e9b674a768fcf534335f172664aaf13dc2c79023
CPU threads: 16; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL
Comment 9 Roman Kuznetsov 2022-05-25 10:11:29 UTC
25 sec and you can work with the DOC document in

Version: 7.4.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: b6266207b55a7633dc82b02142215757512adfb7
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

Igor, your times were:

sppfd249.doc 
LibreOffice 7.1.1.2 - 1m 50s
MS Office 2016 - 20sec

Please retest it yourself in current 7.4 build
Comment 10 QA Administrators 2023-05-13 03:19:10 UTC Comment hidden (obsolete)
Comment 11 Roman Kuznetsov 2023-05-13 11:20:49 UTC
30 sec for DOC opening (and end of post processing!) 

30 sec for DOCX opening (and end of post processing!) 

1 min 40 sec for ODT opening (and end of post processing!) 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 69d0be09ad81935f7da4b6f8d036c3562357d068
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded

let's keep this one as NEW
Comment 12 Buovjaga 2024-10-08 15:33:39 UTC
Created attachment 196961 [details]
Perf flamegraph of ODT opening

Opened attachment 170885 [details] with

export OOO_EXIT_POST_STARTUP=1; perf record -F 200 --call-graph dwarf,62000 ~/libreofficetwo/instdir/program/soffice

Arch Linux 64-bit
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 40beeb144a00c9725cde4239c251f67c658d31a8
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 6 October 2024
Comment 13 Commit Notification 2025-03-22 13:34:15 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4503abd1a6788a5c3cb2168f23b63559a6cabebf

tdf#141415 speed up a perf hotspot in SalLayout

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2025-03-22 16:27:34 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8c0d8f50717503d8fe45aed95055b2c9e2227c0d

tdf#141415 reduce time spent loading language data

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Buovjaga 2025-03-23 10:00:59 UTC
After Noel's commits I tested again. With OOO_EXIT_POST_STARTUP=1 I see opening time improved from 11 secs to 9, but testing with gtk3 UI even in 25.2 scrolling to the end happens pretty much in real time. So Igor definitely should test again, preferably with a daily 25.8 build.

Arch Linux 64-bit
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b1576ba17a4111f02fc6f8e27c09c78dbd7fd963
CPU threads: 8; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 23 March 2025
Comment 16 Noel Grandin 2025-03-23 12:45:38 UTC
I didn't make much improvement :-)
 I think someone else (not sure who) deserves the real credit, it was already pretty good on master.