Bug 116340 - FILEOPEN XLSX Opening an .xlsb file with LibreOffice Calc is much slower than opening the same file with .xlsx extension
Summary: FILEOPEN XLSX Opening an .xlsb file with LibreOffice Calc is much slower than...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx, perf
Depends on:
Blocks: XLSX
  Show dependency treegraph
 
Reported: 2018-03-10 16:09 UTC by Gabor Kelemen (allotropia)
Modified: 2022-10-23 12:32 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel 2013 (193.71 KB, application/vnd.ms-excel.sheet.binary.macroEnabled.12)
2018-03-10 16:09 UTC, Gabor Kelemen (allotropia)
Details
The same example as xslx from Excel 2013 (318.03 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-03-10 16:12 UTC, Gabor Kelemen (allotropia)
Details
The example file opened in Excel and Calc (263.33 KB, image/png)
2018-03-10 16:17 UTC, Gabor Kelemen (allotropia)
Details
The example XLSX file saved by LO 6. No change here. (267.60 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-03-10 16:19 UTC, Gabor Kelemen (allotropia)
Details
The example XLSB file saved by LO 6 as XLSX. Formula has changed. (269.02 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-03-10 16:20 UTC, Gabor Kelemen (allotropia)
Details
The exported XLSX opened in Excel and LO with #NAME error in Excel (284.66 KB, image/png)
2018-03-10 16:21 UTC, Gabor Kelemen (allotropia)
Details
perf flamegraph (136.85 KB, application/x-bzip)
2019-11-24 20:03 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-03-10 16:09:09 UTC
Created attachment 140551 [details]
Example file from Excel 2013

FILEOPEN XLSX Opening an .xlsb file with LibreOffice Calc is much slower than opening the same file with .xlsx extension

The main problem here is the time difference of opening an .xlsb file compared to an .xlsx file. The reason of the slower file load is the conversion of a function formula. Certain references in an .xlsb file were replaced with another function.

Steps to reproduce:
1. Create a new spreadsheet with Microsoft Excel 2010/2013/2016
2. Insert a three columns table to the spreadsheet.
3. Insert a letter to the first column (Column1) and insert numbers to the second column (Column2) from the first row of the table to the 10000th row at least. (just to see the import of time difference) 
4. Insert this function “=IF(A4="";"";IF(COUNTIF(Táblázat1[Oszlop2];B4)>1;"dupla!";"OK"))” to the third column (Column3) from the first row of the table to the 10000th row at least.
5. Save the file as *.XLSX and save as an *.XLSB file with Microsoft Excel.
6. First, open the *.XLSX file with LibreOffice Calc. (it will be opened very fast and the function remains unchanged)
7. Second, open the *.XLSB file with LibreOffice Calc. (it will be opened much more slower than the *.XLSX file and the function changed)

Actual results:
After we opened the *.XLSB file the function looked like this: “=IF(A21="";"";IF(COUNTIF(OFFSET(Táblázat1;1;1;ROWS(Táblázat1)-1;1);B21)>1;"dupla!";"OK"))”. The “Táblázat1[Oszlop2]” reference was replaced with “OFFSET(Táblázat1;1;1;ROWS(Táblázat1)-1;1)”. Because of this the file opened much more slower than an *.XLSX file.
We met an *.XLSB file which contains much more data (25000 Kb) than the example file. Because of this problem LibreOffice Calc 6.0.0.1 could not open that file and soffice.exe/soffice.bin was frozen.
Another problem:
If we open the *.XLSB file with LibreOffice Calc and save as *.XLSX (because in the LibreOffice Calc we cannot save as *.XLSB), the modified formula was saved of course. And we open it with Microsoft Excel we got a #NAME? error message in the cells.

Expected results:
The function formula should not be modified after we import an *.XLSB file (because of the loading time). In the *.XLSX file the function formula was not modified.

Version: 6.0.0.1.0+
Build ID: c678dc5309741097d9b0265f03dd279a8794d256
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:libreoffice-6-0, Time: 2017-12-28_04:21:33
Locale: hu-HU (hu_HU); Calc: group
Comment 1 Gabor Kelemen (allotropia) 2018-03-10 16:12:58 UTC
Created attachment 140552 [details]
The same example as xslx from Excel 2013
Comment 2 Gabor Kelemen (allotropia) 2018-03-10 16:17:45 UTC
Created attachment 140553 [details]
The example file opened in Excel and Calc

Sorry for the Hungarian function names. 
In Excel, HA = IF, DARABTELI = COUNTIF. 
In Calc, HA = IF, DARABTELI = COUNTIF, ELTOLÁS = OFFSET, SOROK = ROWS. 
The latter two were not present in Excel.
Comment 3 Gabor Kelemen (allotropia) 2018-03-10 16:19:40 UTC
Created attachment 140554 [details]
The example XLSX file saved by LO 6. No change here.
Comment 4 Gabor Kelemen (allotropia) 2018-03-10 16:20:19 UTC
Created attachment 140555 [details]
The example XLSB file saved by LO 6 as XLSX. Formula has changed.
Comment 5 Gabor Kelemen (allotropia) 2018-03-10 16:21:05 UTC
Created attachment 140556 [details]
The exported XLSX opened in Excel and LO with #NAME error in Excel
Comment 6 Buovjaga 2018-03-14 14:51:30 UTC
Assuming this is confirmed by the Hungarian team -> NEW
Comment 7 QA Administrators 2019-11-07 03:35:06 UTC Comment hidden (obsolete)
Comment 8 Roman Kuznetsov 2019-11-24 15:56:55 UTC
still repro in

Версия: 6.5.0.0.alpha0+ (x64)
ID сборки: 32dcf3f0fdafcf44457842a8aa4f54d30d856ca9
Потоков ЦП: 4; ОС:Windows 10.0 Build 17763; Отрисовка ИП: GL; VCL: win; 
Локаль: ru-RU (ru_RU); Язык интерфейса: ru-RU
Calc: threaded

It took over 10 sec for XLSB and only 2 sec for XLSX

Julien, can you create your nice flamegraph for this case?
Comment 9 Julien Nabet 2019-11-24 20:03:07 UTC
Created attachment 156078 [details]
perf flamegraph

Here's a Flamegraph retrieved on pc Debian x86-64 with master sources updated today + enable-symbols
Comment 10 Roman Kuznetsov 2019-11-24 20:07:48 UTC
Noel, possibly you'll can look at it? Thanks
Comment 11 Noel Grandin 2019-11-25 11:30:38 UTC
This is not a perf issue, this is some kind of document import/conversion fidelity issue
Comment 12 Buovjaga 2021-05-03 10:22:53 UTC
Difference still observed

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 13 Roman Kuznetsov 2022-10-23 12:32:10 UTC
LibreOffice

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 9d1d668a608cc5b406601c2f7f3d8581e8f47d1c
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded

opens the XLSB file just instantly

Closed as WFM