Bug 136991 - Open RTF with colored text slower from 4.1 and 4.2
Summary: Open RTF with colored text slower from 4.1 and 4.2
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.6.0
Keywords: bibisected, bisected, perf, regression
Depends on:
Blocks: RTF-New-Import
  Show dependency treegraph
 
Reported: 2020-09-24 06:45 UTC by Pit Hauge
Modified: 2023-06-08 04:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
file which needs 27 seconds to be opened (44.85 KB, application/rtf)
2020-09-24 06:48 UTC, Pit Hauge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pit Hauge 2020-09-24 06:45:33 UTC Comment hidden (obsolete)
Comment 1 Pit Hauge 2020-09-24 06:48:46 UTC
Created attachment 165803 [details]
file which needs 27 seconds to be opened
Comment 2 Telesto 2020-09-24 22:04:07 UTC
Confirm with
Version: 7.0.0.2
Build ID: c01aa64b6c3d89ebe5fe69c28c7adb24eb85249c
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 3 Telesto 2020-09-30 20:49:54 UTC
Not fast with 
4.4.7.2

It's faster with
Versie 4.0.0.3 (Bouw-id: 7545bee9c2a0782548772a21bc84a9dcc583b89)

even Word needs some time.. so 4.0 speed should be seen as normal
Comment 4 Roman Kuznetsov 2021-02-25 19:56:40 UTC
It took about 15 sec in

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: d8ed3bda462b351d2b98ec57cfdb879e0eec0010
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

But MS Word 2007 opens it momentally
Comment 5 Timur 2021-05-06 10:38:00 UTC
Test Linux with GEN. I didn't test 4.0 because no 4.0max, but looks like double slow down in 4.1 and 4.2. 

4.1 oldest:
real	0m15,850s
user	0m13,879s
sys	0m0,869s

4.1 master:
real	0m25,672s
user	0m19,025s
sys	0m1,161s

4.2 master:
real	0m50,422s
user	0m45,278s
sys	0m0,365s

7.2+:
real	0m48,525s
user	0m44,618s
sys	0m0,727s


Bibisect in 4.1 had many skipped commits. I'll write in the next post and hide.
Here is a range, multiple devs.
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=f5cde53719544c7445ab6fdb465e332ac5678b02..a84663a612053389703472dbd7aac4a4b9e7df7b
Comment 6 Timur 2021-05-06 10:38:18 UTC Comment hidden (obsolete)
Comment 7 Timur 2021-05-06 11:25:46 UTC
Bibisect in 4.2max for the 1st regression (there was at least another one):
 ac6f8204aa613314701d6ab0a5f25e2c50480dff is the first bad commit
Date:   Sat Sep 5 18:31:33 2015 +0800

    source-hash-6db39dbd7378351f6476f6db25eb7110c9cfb291
    previous source-hash-e012f326c1c32c053304998a6826cb322f2c7728
   
    Author:     Michael Stahl <mstahl@redhat.com>
    AuthorDate: Sat Jun 15 21:25:27 2013 +0200
    Commit:     Michael Stahl <mstahl@redhat.com>
    CommitDate: Thu Jun 20 00:34:38 2013 +0200
    
        fdo#52028: sw: let text formatting ignore RSID in automatic styles

https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e012f326c1c32c053304998a6826cb322f2c7728..6db39dbd7378351f6476f6db25eb7110c9cfb291
Comment 8 Timur 2021-05-06 11:45:19 UTC
Bibisect in 4.2max for the 2nd regression
 8a8b50772859fd6198e8e139ca853a4b7aca9133 is the first bad commit
Date:   Sat Sep 5 22:42:31 2015 +0800

    source-hash-b8002169336b6b7597d32755e41fa3dc2688539e
    previous source-hash-7fb73e6c30e66f028fe759376e3789456bf3ad33    
    
    commit b8002169336b6b7597d32755e41fa3dc2688539e
    Author:     Michael Stahl <mstahl@redhat.com>
    AuthorDate: Wed Nov 6 16:36:04 2013 +0100
    Commit:     Michael Stahl <mstahl@redhat.com>
    CommitDate: Thu Nov 7 14:27:50 2013 -0600
    
        remove INPATH and PROEXT

https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=7fb73e6c30e66f028fe759376e3789456bf3ad33..b8002169336b6b7597d32755e41fa3dc2688539e

CC: Michael, at least 2 commits are yours, please see.
Comment 9 Michael Stahl (allotropia) 2021-05-07 11:33:14 UTC Comment hidden (obsolete)
Comment 10 Timur 2021-05-07 13:06:26 UTC
(In reply to Michael Stahl (allotropia) from comment #9)
> pretty sure this is wrong, the problem with that bibisect was that it had
> incremental builds so the real commit is earlier than this one.

I you mean that 42max had more sources per binary commit, I used ^1 to get previous commit and wrote previous source, so here it's a single source, as written. 
I used "time" to find and verify seconds.
Comment 11 Commit Notification 2021-08-10 13:36:32 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4d50939a7b37cbaeceeddebabfc435190e079781

tdf#136991 Open RTF with colored text

It will be available in 7.3.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 12 Buovjaga 2021-09-02 09:26:37 UTC
The previous commit takes it from 11 secs to 8 secs for me (Linux).
Comment 13 Timur 2021-09-02 15:08:25 UTC
Retest od 2nd load in addition to comment 5:

4.1. oldest
real	0m13,994s
user	0m12,867s
sys	0m0,452s

4.1. master:
real	0m19,498s
user	0m18,608s
sys	0m0,405s

7.3+:
real	0m22,562s
user	0m21,494s
sys	0m0,512s

Improved comparing to 4.2 and 7.2 but still worse comparing to 4.1 oldest.
Comment 14 Pit Hauge 2021-12-16 12:05:54 UTC
It still takes an incredibly long time to load this 45 KB file. I just tried to open it by version 7.1.7: 41.0 seconds. To compare with a really large file with text and pictures, 9086 KB: 5.0 seconds.

Then I downloaded and installed the just released version 7.1.8. New result:
45 KB in 31.6 seconds
9086 KB in 7.0 seconds

A file 200 times larger takes less than a quarter of the time to be loaded! So really size doesn't matter :-)
Comment 15 Buovjaga 2021-12-16 12:34:48 UTC
(In reply to Pit Hauge from comment #14)
> It still takes an incredibly long time to load this 45 KB file. I just tried
> to open it by version 7.1.7: 41.0 seconds. To compare with a really large
> file with text and pictures, 9086 KB: 5.0 seconds.
> 
> Then I downloaded and installed the just released version 7.1.8. New result:
> 45 KB in 31.6 seconds
> 9086 KB in 7.0 seconds
> 
> A file 200 times larger takes less than a quarter of the time to be loaded!
> So really size doesn't matter :-)

In 7.2 (Linux) I get 14 secs, but with 7.4 I get only 4 secs, so please test with a fresh master build. If you're on Windows, you want Win-x86_64@tb77-TDF from https://dev-builds.libreoffice.org/daily/master/current.html
Comment 16 Timur 2022-01-07 14:30:24 UTC
Retest of 2nd load:
4.1 oldest:   5,96s user 0,25s system 91% cpu 6,762 total
4.1 master:   8,84s user 0,35s system 94% cpu 9,709 total
7.3 oldest:  22,10s user 0,26s system 98% cpu 22,631 total
7.3 master:   8,71s user 0,36s system 97% cpu 9,318 total
7.4 master:   8,44s user 0,29s system 94% cpu 9,190 total

As noted before, there was improvement in 7.3 but not some other in 7.4.
Comment 17 Commit Notification 2023-05-03 16:34:22 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a0dd4cd98504124362524727c5f9eae731c1944f

tdf#136991 reorganise lcl_ExportHints loop

It will be available in 7.6.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 18 Commit Notification 2023-05-03 17:13:30 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b779b948cc46461b9c7aaa0a01d719879dfe65e5

tdf#136991 speed up large rtf load

It will be available in 7.6.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 19 Commit Notification 2023-05-03 17:13:32 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e19c102e87002f953f2eb28c154da8f54b70068e

tdf#136991 speed up rtf load

It will be available in 7.6.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 20 BogdanB 2023-05-04 04:47:38 UTC
Retested multiple times with master: 7.6
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8d8779808063aeedcf0d2b7efba3d2f82e0d7bef
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
real	0m4,528s
user	0m4,253s
sys	0m0,309s

real	0m5,961s
user	0m4,328s
sys	0m0,328s

real	0m5,128s
user	0m4,472s
sys	0m0,315s

------------------------------------------
And this is with
Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.2
Calc: threaded 

real	0m8,830s
user	0m6,466s
sys	0m0,591s

real	0m7,011s
user	0m5,512s
sys	0m0,365s

real	0m6,959s
user	0m5,302s
sys	0m0,412s
Comment 21 Buovjaga 2023-06-07 16:43:32 UTC
Based on the previous comment, this could be closed as fixed, right?
Comment 22 BogdanB 2023-06-08 04:34:00 UTC
Telesto, Pit Hauge, can you test again this bug using 7.6? Maybe even using Mac?