Bug Hunting Session
Bug 109269 - very slow loading of user-defined dictionary word list
Summary: very slow loading of user-defined dictionary word list
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0 target:6.1.0.1
Keywords: perf
Depends on:
Blocks: Dictionaries
  Show dependency treegraph
 
Reported: 2017-07-22 10:34 UTC by tommy27
Modified: 2018-06-26 12:58 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
put this file in the "wordbook" subfolder of the user profile (76.66 KB, text/plain)
2017-07-22 10:34 UTC, tommy27
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tommy27 2017-07-22 10:34:28 UTC
Created attachment 134780 [details]
put this file in the "wordbook" subfolder of the user profile

loading the word list of a "user-defined dictionary" has always been quite slow since OOo era. 

considering the small size and limited amout of data in those dictionary files, it looks to me the LibO is underperforming and needs improvement.

this issue is noticeable when you deal with relatively large files like the one I attached (so you need that one to retest).

STEPS TO REPRODUCE
1- put the attached "standard.dic" under the "wordbook" subfolder of your user profile
2- open a Writer document
3- click on "Tools/Options/Language Settings/Writing Aids"
4- select "standard" in the "User-defined dictionaries" field and click "Edit…"
5- measure the time needed to display the word list

EXPECTED BEHAVIOUR
the word list should be displayed immediately of just in a few seconds

CURRENT BEHAVIOUR
LibO hangs and takes 13 seconds to display the whole list.

TESTED UNDER:
Windows XP 32bit, 7 64bit and 8.1 64 bit.

reproducible with old OOo releases and Libo since 3.3.0 till current 5.3.4.2 and recent 6.0.0.0 alpha daily builds.
Comment 1 Jean-Baptiste Faure 2017-07-22 15:36:59 UTC
Indeed opening this dictionary is quite long, 7-8 seconds on my PC with SSD and under ubuntu 16.04. Even if the file is externally sorted (using a text editor), LO needs the same time to show the file contents.

Setting as NEW.

Best regards. JBF
Comment 2 tommy27 2017-07-22 15:51:10 UTC
thanks for confirming.
I wonder where all this time is spent to open a small file such this one... 
only 76.66!!!
Comment 3 Yousuf Philips (jay) (retired) 2017-07-24 12:01:41 UTC
@Meeks, @Aron: Is a callgrind needed to find out what is slowing things down?
Comment 4 tommy27 2018-05-26 05:18:26 UTC
bug still present in LibO in 6.0.4.2 (tested under Win8.1 x64)
Comment 5 Michael Meeks 2018-05-28 08:59:29 UTC
Sure - a callgrind would be useful, as you say that is far too slow to load anything but a gigantic document - there must be somet horrible N^3 or N^2 in there that we don't need.
Comment 6 Commit Notification 2018-06-25 10:35:15 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#109269 very slow loading of user-defined dictionary word list

It will be available in 6.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 2018-06-25 13:25:09 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

followup fix for "tdf#109269 very slow loading of user-defined dictionary"

It will be available in 6.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 2018-06-26 06:09:36 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

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

tdf#109269 very slow loading of user-defined dictionary word list

It will be available in 6.1.0.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 9 tommy27 2018-06-26 12:58:33 UTC
I confirm the bug is gone under Win7 x64 using LibO 6.2.0.0.alpha0+
Build ID: 757d9e43315755869af30e79c0457fd529cb050a
CPU threads: 8; OS: Windows 6.1; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-06-26_02:27:27
Locale: it-IT (it_IT); Calc: group threaded

the user-defined dictionary word list now loads fast.

well done Noel!!!