Bug 107357 - Calc is taking several seconds to switch between tabs
Summary: Calc is taking several seconds to switch between tabs
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-22 18:37 UTC by robert
Modified: 2017-04-23 23:28 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
demonstrates the slowness in switching tabs (218.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-04-22 23:02 UTC, robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert 2017-04-22 18:37:27 UTC
Description:
The application has become nearly unusable.  I have about 12 (tabs/pages/sheets) in my ods document.  There are formula in about 800 rows and 15 columns on each page.  There are no linkages between the sheets or other ods.  The computer is running Windows 10 Pro on an i7-4700HQ with 16GB ram. I have the 64-bit LibreOffice 5.3.2.2 installed.  Java Version is 8 Update 131 64-bit.



Steps to Reproduce:
1. Build a spreadsheet ODS with several tabs 12
2. enter formula on each that fill about 800 rows
3. save, close and reopen.
4. click on a tab
5. try to enter data in a cell.

Actual Results:  
* Upon clicking a tab at the bottom there is a 2-3 second wait for the page to appear.  This behavior just appeared in this version of LibreOffice.

* Upon initial opening the ods file you can type a single or two numbers into a cell and then the application stops responding for 10-20 seconds.  This behavior has gotten worse with each version.  


Expected Results:
This is not that large of a spreadsheet and the computer it is on is not slow with the same spreadsheet loaded into Excel 2012.  This kind of performance will not get corporations to convert.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Comment 1 m_a_riosv 2017-04-22 22:09:17 UTC
Have you conditional formats, charts, or using intensively INDIRECT() or OFFFSET) functions.
Comment 2 robert 2017-04-22 22:59:07 UTC
(In reply to m.a.riosv from comment #1)
> Have you conditional formats, charts, or using intensively INDIRECT() or
> OFFFSET) functions.

There were conditional formats, however, I just recreated the problem with a new spreadsheet.  It only took 4 pages of 800 x 8 formula to start to see the problem start to present itself.

formula are very basic
+,  a,   b,   c,   d,   e,   f,   g,    h
1,  5,   4,   3,   2,   1,   v,   s,    d
2,  0,   0,   0,   0,   0,   =SUM(A2:E2), =IFERROR(ROUND((A2*$A$1+B2*$B$1+C2*$C$1+D2*$D$1+E2*$E$1)/F2,2),0),  =F2-J2
3, a2+1, =b2+0, =c2+0, d2+0, e2+0, =SUM(A3:E3), =IFERROR(ROUND((A3*$A$1+B3*$B$1+C3*$C$1+D3*$D$1+E3*$E$1)/F3,2),0),  =F3-J3

copy last row down to 800 and copy Sheet1 to Sheet2,3,4
Comment 3 robert 2017-04-22 23:02:53 UTC
Created attachment 132757 [details]
demonstrates the slowness in switching tabs
Comment 4 Regis Perdreau 2017-04-22 23:59:51 UTC
Hi

No significant slowness under Lo 5.3.2.2 Win10 32bits (Virtualbox) even with 20 tabs.

Have you any network share ?
Comment 5 robert 2017-04-23 00:35:33 UTC
No network share (assuming you mean drives).  The file is on an SSD, but not sure why the storage of the file would matter for what is in memory.

Using Windows 10 Pro 64-bit and LibreOffice Calc
Version: 5.3.2.2 (x64)
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
CPU Threads: 8; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: en-US (en_US); Calc: group

I too see speedy results within an Ubuntu 17.04 VM Running an older Calc 
Version: 5.3.1.2
Build ID: 1:5.3.1-0ubuntu2
CPU Threads: 1; OS Version: Linux 4.10; UI Render: default; VCL: gtk3; Layout Engine: new; 
Locale: en-US (en_US.UTF-8); Calc: group

So maybe the problem is with the x64 build.
Comment 6 m_a_riosv 2017-04-23 11:41:05 UTC
With sample file switch between sheets it's instantaneous form me, even a hard recalc [Ctrl+F9] has no delay.

Version: 5.3.2.2 (x64)
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: es-ES (es_ES); Calc: group
Versión: 5.3.2.1
Id. de compilación: 7f6693c08cc110b9721245fc4bd4f1712e0c086c
Subpr. de CPU: 4; SO: Windows 6.2; Repr. de IU: predet.; Motor de trazado: HarfBuzz; 
TinderBox: Win-x86@62-merge-TDF, Branch:libreoffice-5-3, Time: 2017-03-25_13:52:57
Configuración regional: es-ES (es_ES); Calc: group

Please test your original file after deleting the conditional formats, on some situations they can slowdown the spreadsheets.

By the way some calculations can be simplified a bit.
=IFERROR(ROUND((A3*$A$1+B3*$B$1+C3*$C$1+D3*$D$1+E3*$E$1)/F3;2);0)
x
=IF(F3;ROUND(SUMPRODUCT(A$1:E$1;A3:E3)/F3;2))
Comment 7 robert 2017-04-23 12:11:16 UTC
The behavior has been repeated without the conditional formatting.  Is there a way to remove conditional formatting for an entire page?  Also, the conditional formatting on the original spreadsheet is needed and works fine when opened with Excel.  It would be great if both issues can be resolved.

Thanks for the formula tip in the example, but hopefully, Calc isn't susceptible speed issues of particular formula, especially ones involving multiplication, addition and division.
Comment 8 m_a_riosv 2017-04-23 12:31:31 UTC
To delete quicker:
Menu/format/conditional formating/manage
[Ctrl+A]

The question is discard as source of the issue.
Are you using functions like STYLE in the conditions?.
Comment 9 robert 2017-04-23 13:48:48 UTC
Okay, I have removed all formatting from the original spreadsheet for which I opened the bug report.  All fonts are Arial non-bold non-colored, non-background colored.  There were style conditions, they are all now removed.  The formula change you suggested has been made.  There is essentially no difference in the time to switch tabs.  2-3 seconds.

This behavior was present in the spreadsheet I uploaded which had none of that formatting, so I don't think the bug is related to any of the following:
- Font
- Formula nature
- Conditional formatting
- Formatting (bold, color, background)

Finally, loading any of the spreadsheets (with or without formatting) into Calc 5.3.1.2 on an Ubuntu VM (running on the same machine) is much more responsive.  

I don't have a 32-bit version of the 5.3.2.2 to test, but I think the 64-bit has a problem.  I will download the lastest 32-bit version and test, but have limited download speed.
Comment 10 robert 2017-04-23 16:18:50 UTC
Similar performance slowness with the 32-bit version and the example spreadsheet that was attached.
Comment 11 m_a_riosv 2017-04-23 20:27:04 UTC
please what's the status of OpenCL options?
Menu/Tools/LibreOffice/OpenCL
Comment 12 robert 2017-04-23 20:35:34 UTC
Allow use of Software Interpreter (even when OpenCL is not available) is checked.
Allow use of OpenCL is unchecked.

And there is text saying "OpenCL is not used."
Comment 13 m_a_riosv 2017-04-23 21:02:24 UTC
Software interpreted I think it's quick enought to avoid the issue.

Please try resetting the user profile, sometimes solves strange issues.
https://wiki.documentfoundation.org/UserProfile
Usually it's enough renaming/deleting the file "user/registrymodifications.xcu",  it affects all the options in Menu/Tools/Options, and the files "user/basic/dialog.xlc" and "scrip.xlc" are overwritten, additionally custom colors in "user/config/standard.soc" are lost.
Comment 14 robert 2017-04-23 22:02:38 UTC
Seems much better.
Comment 15 m_a_riosv 2017-04-23 23:28:58 UTC
Then considerer as works for me, please if you are not agree reopen it.