Bug 98458 - SLOW searches via FIND in LARGE odt-files: writer 5 ONLY
Summary: SLOW searches via FIND in LARGE odt-files: writer 5 ONLY
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.2.0 target:5.1.3 target:5.0.6
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2016-03-06 02:23 UTC by Bob Crumb
Modified: 2016-10-25 19:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
4000 page test doc (Aeneid) (4.51 MB, application/vnd.oasis.opendocument.text)
2016-03-06 05:08 UTC, Robinson Tryon (qubit)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Crumb 2016-03-06 02:23:58 UTC
Hi,
I'm doing searches via Find(Ctrl+F) for key words like
"12345 abc" in odt-files as large as 5000 pages.

Starting my search with the active cursor on page 1
and the key word like "12345 abc" appearing the first
time on page 5000,

in writer 4.4.7.2 and older the search takes as less than
about 1 second,

while in writer 5 (all versions) the whole search takes
about 15 seconds,

making writer 5 unusable for my efforts, so I had to go
back to 4.

Appears to be an indexing problem in writer 5, when I open
a document in writer 4, it always starts automatically counting
words and characters and is somehow indexing them, not so in 5?!

Kind regards,
Bob
Comment 1 Robinson Tryon (qubit) 2016-03-06 05:08:16 UTC
Created attachment 123332 [details]
4000 page test doc (Aeneid)
Comment 2 Robinson Tryon (qubit) 2016-03-06 05:26:03 UTC
TESTING on Ubuntu 14.04 64bit

(In reply to Bob Crumb from comment #0)
> Starting my search with the active cursor on page 1
> and the key word like "12345 abc" appearing the first
> time on page 5000,
> 
> in writer 4.4.7.2 and older the search takes as less than
> about 1 second,

No test doc included, so I attach a 4000 page one (attachment 123332 [details]). Last word in doc is 'TESTPHRASE'.

With LO 4.2.8.2 (Ubuntu-provided):
Load time: 23 sec
Search time: < 1 sec (nearly instantaneous)

> while in writer 5 (all versions) the whole search takes
> about 15 seconds,

With LO 5.1.0.1:
Load time: 21 sec
Search time: 27 sec

With LO 5.2.0.0.alpha0+ (2016-02-24_23:58:47)
Load time: 20 sec
Search time: 27 sec

Definitely a large slow-down, so
Status -> NEW
Comment 3 raal 2016-03-07 20:58:27 UTC
This seems to have begun at the below commit.
Adding Cc: to Miklos Vajna ; Could you possibly take a look at this one?
Thanks

 52aa78029015d75c07646ec483cee4f7d4de274b is the first bad commit
commit 52aa78029015d75c07646ec483cee4f7d4de274b
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Wed May 27 23:38:33 2015 +0800

    source-hash-bdc1824ea7acfa2fe9d71cdbe57882acce155577
    
    commit bdc1824ea7acfa2fe9d71cdbe57882acce155577
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    AuthorDate: Tue May 19 17:20:10 2015 +0200
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Tue May 19 17:35:03 2015 +0200
    
        SwPaM::Find: search in shapes anchored to the range
    
        Change-Id: I028f95029deaebddcacf2730d429ad53abbc79fa
Comment 4 Commit Notification 2016-03-17 07:36:10 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#98458 sw: make search in shape text optional

It will be available in 5.2.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 5 Miklos Vajna 2016-03-17 07:48:27 UTC
With the above commit the search speed is again around ~instant in the doc of 4000 pages. I'll propose backporting this to libreoffice-5-1 and libreoffice-5-0.
Comment 6 Commit Notification 2016-03-17 17:13:19 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

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

Revert "tdf#98458 sw: make search in shape text optional"

It will be available in 5.2.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 7 Commit Notification 2016-03-17 17:13:22 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

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

tdf#98458 sw: Fix performance problem when searching in large documents.

It will be available in 5.2.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 8 Commit Notification 2016-03-17 20:55:47 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

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

tdf#98458 sw: Fix performance problem when searching in large documents.

It will be available in 5.1.3.

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 9 Commit Notification 2016-03-17 20:58:19 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=80d1589229926122adad60ff4ca1b045a54a5efa&h=libreoffice-5-0

tdf#98458 sw: Fix performance problem when searching in large documents.

It will be available in 5.0.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 10 Jean-Baptiste Faure 2016-03-18 06:00:16 UTC
Verified in LO 5.1.3.0.0+ built at home under Ubuntu 15.10 x86-64.

Thank you very much.
Best regards. JBF