Bug 45679 - [Calc] [AutoFilter] freezes when applied on large number of timestamp values
Summary: [Calc] [AutoFilter] freezes when applied on large number of timestamp values
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium critical
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.6.0 target:3.5.2
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-02-06 02:39 UTC by Michel Rudelle
Modified: 2012-03-26 08:42 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
spreadsheet containing a large number of timestamp values (284.03 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-02-06 02:39 UTC, Michel Rudelle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Rudelle 2012-02-06 02:39:11 UTC
Created attachment 56652 [details]
spreadsheet containing a large number of timestamp values

Hi, please, see the joined example
LibO 3.5.0 rc3 / Windows 7
(tested on 3.4.5: no problem)
Comment 1 Alex Thurgood 2012-02-06 03:15:17 UTC
Hi,

Doesn't crash on Mac OSX 10.6.8, but it does take 40 seconds to display the filter dialogue.


Alex
Comment 2 Alex Thurgood 2012-02-06 03:20:07 UTC
To compare, in 3.3.4, on Mac OSX 10.6.8, the filter dialogue appears almost instantaneously on the same file - performance regression.

Alex
Comment 3 Alex Thurgood 2012-02-06 03:22:18 UTC
(In reply to comment #2)
> To compare, in 3.3.4, on Mac OSX 10.6.8, the filter dialogue appears almost
> instantaneously on the same file - performance regression.
> 
> Alex


Compared also with 3.4.5, filter dialog appears almost instantaneously.


Alex
Comment 4 Jean-Baptiste Faure 2012-02-08 22:35:15 UTC
Confirming the worse performance comparing to LO 3.4.5.
In fact Calc does not freeze, it works hard : CPU 100% on one core until autofilter popup is shown.

Kohei: it seems it is for you. :-) Please, feel free to reassign if you can't handle this bug report.

Best regards. JBF
Comment 5 Jean-Baptiste Faure 2012-02-11 04:57:14 UTC
Changing platform and OS to All because I reproduce the problem on Ubuntu too.

Best regards. JBF
Comment 6 Markus Mohrhard 2012-02-13 15:22:40 UTC
Had a wuick look into this one and I think we need to move SvListView from tools::Table to boost::ptr_map to solve this problem.
Comment 7 Not Assigned 2012-02-19 21:51:40 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1c9f0a6ddb48f7b6d62670901e117b25a0e59713

move SvListView from Table to ptr_map, related fdo#45679
Comment 8 Markus Mohrhard 2012-02-19 21:55:49 UTC
This was only a first step. There are some more problems here.

Filling the dialog with data is in O(n^2) and not in O(n). The same problem is know for the Manage Names Dialog.
Comment 9 Markus Mohrhard 2012-03-25 18:21:23 UTC
I'll take this one.

As discussed with Kohei we have several solutions to the problem. I will for now implement the init solution.

This means that I'll add a init method taking a vector<rtl::OUString> to get initializing the dialog into O(n). (Initializing the vector will still be in O(n^2) because we need to prevent duplicates. This should still be way faster than the old algorithm which needed to sync a lot of data after adding each entry.
Comment 10 Markus Mohrhard 2012-03-25 20:06:39 UTC
It was even much more easy than I ever imagined. By luck I stumbled over SetUpdateMode which kills the O(n^2) algorithm in the dialog.

Implemented the same for the range names dialogs. I think we will see those fixes in 3.5.3

I think someone else had the same problem but did not document the use of the method.
Comment 11 Not Assigned 2012-03-25 20:12:42 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

prevent update during init in new autofilter dlg, fdo#45679
Comment 12 Not Assigned 2012-03-25 20:13:09 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

prevent update during init in name dlgs, related fdo#45679
Comment 13 Jean-Baptiste Faure 2012-03-26 00:33:40 UTC
Tested in master (LibreOffice 3.6.0alpha0+ Build ID: 08ba87c-49d3d39-e67b1bf-879ce36-638d9c). Very impressive ! :-)

Best regards. JBF
Comment 14 Not Assigned 2012-03-26 03:16:37 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=801c5d5b88454f659a08d9a4940b90499bec9584&g=libreoffice-3-5

prevent update during init in new autofilter dlg, fdo#45679


It will be available in LibreOffice 3.5.3.
Comment 15 Not Assigned 2012-03-26 08:42:37 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=208d129b7214eaedfc3dd22f78330c099d680dd3&g=libreoffice-3-5-2

prevent update during init in new autofilter dlg, fdo#45679


It will be available already in LibreOffice 3.5.2.