Bug 154486 - A document with thousands of tables loads very slow, time grows quadratically
Summary: A document with thousands of tables loads very slow, time grows quadratically
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.6.0 target:7.5.3
Keywords: perf
Depends on:
Blocks:
 
Reported: 2023-03-30 19:27 UTC by Mike Kaganski
Modified: 2023-04-05 09:19 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
10 000 empty 1-cell tables (1.27 MB, application/vnd.oasis.opendocument.text)
2023-03-30 19:27 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-03-30 19:27:57 UTC
Created attachment 186334 [details]
10 000 empty 1-cell tables

The attachment FODT contains 10 000 tables, each 1-cell, after each table, there is a single empty paragraph. The tables don't have names. This is a simplified sample, similar to a real case of generated file containing thousands of small tables, having no or repeating names.

The problem is that the file loads very slowly: it takes almost 40 s on my system. Doubling the number of the tables makes the load time around 170 s.

If the file is opened and then saved, the time to load the saved copy is about 23 s, also very slow.

The quadratic algorithms need fixing.
Comment 1 Commit Notification 2023-03-31 09:01:22 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1dd71d79e15bd8098e7c17c8fcea3748592a902f

tdf#154486: use importer-local map to deduplicate table names

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 2 Commit Notification 2023-03-31 16:20:11 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#154486: Use known name when inserting the table into the document

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 3 Commit Notification 2023-04-05 09:06:34 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/2d3a182c1e311977764d97a4a7d1dce796ec9b18

tdf#154486: use importer-local map to deduplicate table names

It will be available in 7.5.3.

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 4 Commit Notification 2023-04-05 09:19:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#154486: Use known name when inserting the table into the document

It will be available in 7.5.3.

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.