Bug 130531 - When opening the Amazon KDP print royalty calculator the desktop becomes unresponsive
Summary: When opening the Amazon KDP print royalty calculator the desktop becomes unre...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx, perf
Depends on:
Blocks:
 
Reported: 2020-02-08 16:56 UTC by izoprene
Modified: 2020-05-09 14:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description izoprene 2020-02-08 16:56:53 UTC
Hi, when I try to open this Amazon KDP print royalty calculator with Libreoffice Calc 6.0.7.3 on Ubuntu 18.04.4 LTS, then choose the Amazon store dropdown, Calc and Gnome becomes unresponsive, I cannot choose any other open application. I have to CTRL & ALT & F3 to get into a virtual terminal to safely restart the machine.

The file is a .xlsx file:
https://kdp.amazon.com/help?topicId=G200735480#royalty_calculator

I've tried saving it as an .ods file but it's still the same.

I assume this is some kind of parsing error / edge case oddity with this xlsx file that's locking up Calc?
Comment 1 raal 2020-02-08 20:51:59 UTC
I can not confirm with Version: 7.0.0.0.alpha0+
Build ID: d41d7ecb60fb38204fafcb1aa4595992721855e6
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 

Version 6.0 is quite old, please try newer one. http://www.libreoffice.org/download/libreoffice-fresh/
Comment 2 izoprene 2020-02-08 23:07:31 UTC
I uninstalled the default Libreoffice 6.0.7.3 and installed version 6.4.0.3 via a snap package.

The file opens and is usable, but when I enter values into fields 1, 2, 3 & 4, upon entering a value in field 4 my CPU usage goes very high, Libreoffice almost hangs (OS asks to quit process), but eventually the four lower fields are populated with the calculated values. From that point on, the spreadsheet is reasonably responsive.

Strange how it's taking so long?

System monitor screenshot: https://imgur.com/traRrPg
Comment 3 QA Administrators 2020-02-09 03:43:11 UTC Comment hidden (obsolete)
Comment 4 raal 2020-02-09 06:03:26 UTC
(In reply to izoprene from comment #2)
> I uninstalled the default Libreoffice 6.0.7.3 and installed version 6.4.0.3
> via a snap package.
> 
> The file opens and is usable, but when I enter values into fields 1, 2, 3 &
> 4, upon entering a value in field 4 my CPU usage goes very high, Libreoffice
> almost hangs (OS asks to quit process), but eventually the four lower fields
> are populated with the calculated values. From that point on, the
> spreadsheet is reasonably responsive.
> 
> Strange how it's taking so long?
> 
> System monitor screenshot: https://imgur.com/traRrPg

I can confirm this behaviour, high CPU usage for few seconds, but formulas are complicated. It contains two hidden sheets. 
Printing cost:
=iferror(ROUNDUP(IF($E$11="";0;sumifs($'Lookup Tables'.$G$1:$G$1048576;$'Lookup Tables'.$C$1:$C$1048576;$E$8;$'Lookup Tables'.$D$1:$D$1048576;$C$3;$'Lookup Tables'.$E$1:$E$1048576;"<="&$E$9;$'Lookup Tables'.$F$1:$F$1048576;">="&$E$9)+(sumifs($'Lookup Tables'.$H$1:$H$1048576;$'Lookup Tables'.$C$1:$C$1048576;$E$8;$'Lookup Tables'.$D$1:$D$1048576;$C$3;$'Lookup Tables'.$E$1:$E$1048576;"<="&$E$9;$'Lookup Tables'.$F$1:$F$1048576;">="&$E$9)*$E$9));2);0)

It would be interesting compare with excel
Comment 5 izoprene 2020-02-13 08:19:59 UTC
I've done some research on this spreadsheet and found the following:

The good ones
-------------
Windows 10: Excel 2007 - document doesn't work, the dropdown field are broken.
Windows 10: Office 365 Excel online - works perfectly and fast.
Windows 10: Google sheets online - works perfectly and fast.
Ubuntu 18.04.4 LTS: Google sheets online - works perfectly and fast.

The bad ones
------------
Windows 10: LibreOffice Calc 6.4.0.3 (x64) - works very slowly with the first calcualtion, then fast. This is on an Intel i7 Gen 8 CPU, 8GB!

I think we can just say that this spreadsheet isn't very optimised but does (eventually) work on LibreOffice Calc 6.4.0.3 (x64) albeit a bit slow to start.

I'd like to know why processing is slow slow on a fast machine though...
Comment 6 izoprene 2020-02-13 08:41:11 UTC
Correction:
Not a good one, a bad one:
Windows 10: Excel 2007 - document doesn't work, the dropdown fields are broken.
Comment 7 Buovjaga 2020-05-09 14:10:20 UTC
Bibisected with win 6.2 repo to https://git.libreoffice.org/core/+/bd3baf8dab6c5b8865a33136cc28a016e6ee6afb%5E!/
OOXML import: CalcFormulaTree() is unnecessary, tdf#94925 follow-up

View will trigger recalc of dirty cells, or anything else
accessing formula cell results, so we can avoid a worst case full
blown recalc.

As this is about achieving a more correct result by recalculating, we can't call this a regression. This is why the slowness is only seen in the beginning. Closing.