Bug 133603 - FILESAVE XLSX Saving large amount of data with many character formatting is slow
Summary: FILESAVE XLSX Saving large amount of data with many character formatting is slow
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha1+
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords: perf
Depends on:
Blocks: Performance
  Show dependency treegraph
 
Reported: 2020-06-02 14:11 UTC by NISZ LibreOffice Team
Modified: 2024-07-08 13:00 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel (13.72 MB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-06-02 14:11 UTC, NISZ LibreOffice Team
Details
perf flamegraph (211.61 KB, application/x-bzip)
2020-06-02 16:53 UTC, Julien Nabet
Details
Flamegraph (68.68 KB, application/x-bzip)
2022-03-18 16:11 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-06-02 14:11:18 UTC
Created attachment 161527 [details]
Example file from Excel

Attached user made and neutralized file contains a lot of data with many character level formatting, and nothing else (no formula, images, shapes etc.).
Saving this file to XLSX is somewhat slow, compared to Excel it takes about twice as much time on the same machine (about 12 sec vs 5).
It would be nice to run Flamegraph on this to see if there is anything that stands out.

Steps to reproduce:
    1. Open attached file and save as XLSX

Actual results:
Slower file save than Excel.

Expected results:
Slightly better performance.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 75eeb423196c1e94a0189b7eccff37aed5765853
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

In older versions it was a bit worse, ~17 (6.0) ~22 (5.0) secs.
Comment 1 Julien Nabet 2020-06-02 16:53:40 UTC
Created attachment 161534 [details]
perf flamegraph

Here's a Flamegraph retrieved on pc Debian x86-64 with master sources updated today.
Comment 2 NISZ LibreOffice Team 2020-07-10 08:46:23 UTC
@Noel Grandin Thought can you might be interested in this one...
Comment 3 Xisco Faulí 2020-07-10 15:53:58 UTC
it takes ( import and export )

real	0m23,882s
user	0m28,942s
sys	0m2,597s

in

Version: 7.1.0.0.alpha0+
Build ID: 12bfedfac3b141fe6c91b0e5ae5b3fb2ba817c48
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

not too bad...
Comment 4 Buovjaga 2021-05-03 11:09:02 UTC
Saving takes 11 secs in

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 9c930c4f3109d123c0831d0fcecf9c8b32e5bbc7
CPU threads: 2; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded
Comment 5 Commit Notification 2022-03-18 09:00:17 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7cb91a40e20b0ea405042429a1b497bf3c983e01

tdf#133603 cache languagetag in FontSubstConfiguration

It will be available in 7.4.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 6 Commit Notification 2022-03-18 09:14:31 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#133603 reduce some ref-counting during XLSX save

It will be available in 7.4.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 7 Commit Notification 2022-03-18 10:19:18 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#133603 remove some string copying

It will be available in 7.4.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 8 Commit Notification 2022-03-18 11:53:55 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#133603 increase cache size in CachedOutputStream

It will be available in 7.4.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 9 Julien Nabet 2022-03-18 16:11:25 UTC
Created attachment 178955 [details]
Flamegraph

I don't know if it can still be improved but just in case, here's an updated Flamegraph retrieved on pc Debian x86-64 with master sources updated today (b3bd864f7c05c3c794b431dea2ec91ad459812e7).
Comment 10 BogdanB 2022-12-29 06:00:08 UTC
Nisz Team, we need retest for this bug, to see if there are improvments.
Comment 11 Buovjaga 2024-07-08 13:00:03 UTC
Saving takes about 8 secs stopwatch time with

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d8c694b5d64b05da8c515e4ffe23c4bcc2376b0f
CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded