Bug 106872 - Very slow when selecting column (with filter and freeze Rows or Columns enable)
Summary: Very slow when selecting column (with filter and freeze Rows or Columns enable)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.5.1 release
Hardware: All Linux (All)
: medium major
Assignee: Caolán McNamara
QA Contact:
URL:
Whiteboard: target:6.0.0 target:5.4.1 target:5.3.6
Keywords: haveBacktrace, perf
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2017-03-30 12:51 UTC by MichaelB
Modified: 2017-07-28 12:15 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test .ODS file with bug (10.27 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-03-30 12:51 UTC, MichaelB
Details
Video for bug 106872 (442.36 KB, video/mp4)
2017-04-03 12:00 UTC, MichaelB
Details
Callgrind output from 5.4 (7.39 MB, application/x-xz)
2017-04-17 15:42 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MichaelB 2017-03-30 12:51:33 UTC
Created attachment 132284 [details]
Test .ODS file with bug

Hi,

In an calc file (with filter and freeze column is enable) if i select a column (click in the header) the selection is very slow, like a delay of 1 second. Same problem also appear when i select a few columns with my mouse (left click down and move the mouse to the right)

The document become unusable. And with a real production file with something like 30 columns and 1000 rows, all freeze for many seconds..

Please see my test file in attachment with different tabs.

Tabs:

Test-1 ->  freeze column enable / Filter disable  -> RESULT: OK
Test-2 ->  freeze column enable / Filter enable  -> RESULT: FAIL
Test-3 ->  freeze column disable / Filter enable  -> RESULT: OK

Appear on:

5.1.x
5.2.x
5.3.x (not tested)

I'm on Ubuntu 16.04 / i7 / 8Go RAM. I'm not tested if this problem appear on Windows too but i suppose that yes. 

Thanks,
Michael
Comment 1 m.a.riosv 2017-03-30 21:09:35 UTC
I can't reproduce.
Version: 5.3.2.1 (x64)
Build ID: 7f6693c08cc110b9721245fc4bd4f1712e0c086c
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: es-ES (es_ES); Calc: group
Comment 2 MichaelB 2017-04-03 12:00:19 UTC
Created attachment 132309 [details]
Video for bug 106872

Hi,

Just made a little video (.mp4) with my problem. See the second tabs.
It exist a big delay when selecting columns or just click and sometimes
it become unusable (gray screen) and cpu overload for some seconds... 


Version: 5.2.5.1
Build ID: 1:5.2.5~rc1-0ubuntu1~xenial0
Threads CPU : 4; Version de l'OS :Linux 4.8; UI Render : par défaut; VCL : gtk2; 
Locale : fr-CH (fr_CH.UTF-8); Calc: group
Comment 3 m.a.riosv 2017-04-03 14:46:42 UTC
Reproducing your steps I can't reproduce.

Please test on/off OpenCL on Menu/Tools/Options/LibreOffice/View
Comment 4 MichaelB 2017-04-04 06:26:58 UTC
I tested on 3 different pc on Linux (ubuntu 16.04). Problem is the same.

More tests:

- I just tested the new release 5.3.2.2 on Ubuntu 16.04 and problem persist.
- I just tested (5.2.6.2) on Windows 10 and this problem is not present.

So it appear only on linux? I have not tested on Mac.

Enable/Disable OpenCL or OpenGL change nothing.


***** FAIL ******
Version: 5.2.5.1
Build ID: 1:5.2.5~rc1-0ubuntu1~xenial0
Threads CPU : 4; Version de l'OS :Linux 4.8; UI Render : par défaut; VCL : gtk2; 
Locale : fr-CH (fr_CH.UTF-8); Calc: group

Version: 5.3.1.2
Build ID: 1:5.3.1-0ubuntu1~xenial0
Threads CPU : 4; Version de l'OS :Linux 4.8; UI Render : par défaut; VCL : gtk3; Moteur de mise en page : nouveau;
Locale : fr-CH (fr_CH.UTF-8); Calc: group 

Version: 5.3.2.2
Build ID: 1:5.3.2~rc2-0ubuntu1~xenial0
Threads CPU : 4; Version de l'OS :Linux 4.8; UI Render : par défaut; VCL : gtk2; Moteur de mise en page : nouveau; 
Locale : fr-CH (fr_CH.UTF-8); Calc: group



***** OK ******
Version: 5.2.6.2 (x64)
Build ID: a3100ed2409ebf1c212f5048fbe377c281438fdc
Threads CPU : 2; Version de l'OS :Windows 6.19; UI Render : par défaut; 
Locale : fr-CH (fr_CH); Calc: group
Comment 5 Buovjaga 2017-04-17 15:42:55 UTC
Created attachment 132637 [details]
Callgrind output from 5.4

I repro with GTK3, but not with KDE4.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: d69e6321fbb2c9f5b4d30890074a230ee6b39d2d
CPU threads: 8; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on April 17th 2016
Comment 6 MichaelB 2017-05-09 11:58:46 UTC
I suspect this GTK bug to also block all cell calculation in my sheet after some minutes / hours of usage.

We have an inventory file of products (~2000 x ~30), with autofilter, freeze rows and columns enable. We play a lot with autofilter / standard filter. After long minutes of usage (add / remove filter, scroll, update cell values, hide or show columns...) all calculated cell (SUM) are no more refreshed and updated even if i press F9 for recalculation.. The only solution is to restart libreoffice and repoen my file. This is a very dangerous situation...

Anyway.. if someone can fix this bug #106872 quickly, i would be happy ;)
Comment 7 m.a.riosv 2017-05-09 12:27:44 UTC
Surely doing a hard recalc solves your calculation issues.

[Shift+Ctrl+F9]
Comment 8 Caolán McNamara 2017-07-27 14:02:28 UTC
I think this is an accessibility enabled libreoffice vs a non accessibility enabled libreoffice rather than gtk3 vs gtk2. There seems to be a very excessive amount of selection tracking going on and the filtering is expensive when querying the selection via accessibility
Comment 9 Caolán McNamara 2017-07-27 14:27:56 UTC
There's also an irony in that the results of the slow filtering are all thrown away as we're only interested in shapes at this point
Comment 10 Commit Notification 2017-07-27 15:11:31 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=998e3d5cef63cb9c512737bce65519f5a86ba019

Related: tdf#106872 amount of a11y selection listeners constantly grows

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2017-07-27 15:21:18 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=221dae68df80298e81e6e6549636f3528f5c8bc3

Related: tdf#106872 factor out getting selected shapes

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Caolán McNamara 2017-07-27 15:23:34 UTC
Above only stops things getting worse over time. https://gerrit.libreoffice.org/#/c/40496/ is my suggestion to skip all the slow path by just querying for selected shapes rather than all selection which causes the slow down when there is a filter in place
Comment 13 Commit Notification 2017-07-27 16:09:12 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1d9a30bac4ba69ddee34f40427ba24a4d83a1f72&h=libreoffice-5-4

Related: tdf#106872 amount of a11y selection listeners constantly grows

It will be available in 5.4.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2017-07-27 20:20:52 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=09716380e12ac2b7119afff20033ce2e7929ebd8&h=libreoffice-5-3

Related: tdf#106872 amount of a11y selection listeners constantly grows

It will be available in 5.3.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2017-07-28 09:37:32 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=192d97cdf091af08a492416824918ea447bfb16f

Resolves: tdf#106872 only request selected shapes

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2017-07-28 12:15:26 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1e796e4471ceb577b6a5bd577b2571231ae6fcf1&h=libreoffice-5-4

Resolves: tdf#106872 only request selected shapes

It will be available in 5.4.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2017-07-28 12:15:32 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5e2ffa0b2eb7623d0c9ed37c30caea1452810646&h=libreoffice-5-3

Resolves: tdf#106872 only request selected shapes

It will be available in 5.3.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.