[Libreoffice-bugs] [Bug 104332] Thesaurus in the Tools menu causes it to open slowly the first time

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Jun 20 15:47:09 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=104332

--- Comment #23 from Tor Lillqvist <tml at iki.fi> ---
Corresponding SAL_DEBUG output, not from the exact same run, so the timing is a
bit different, here the interesting bit takes over half a second, probably
because I had a build ongoing at the same time:

> 0.000:debug:29870:36165630: >> pyuno::Adapter::invoke(activate,4)
> 0.020:debug:29870:36165630: << pyuno::Adapter::invoke()
> 0.020:debug:29870:36165630: >> pyuno::Adapter::invoke(createInstanceWithContext,1)
> 0.045:debug:29870:36165630: << pyuno::Adapter::invoke()
> 0.046:debug:29870:36165630: >> pyuno::Adapter::invoke(hasLocale,1)
> 0.046:debug:29870:36165630: << pyuno::Adapter::invoke()
> 0.046:debug:29870:36165630: >> pyuno::Adapter::invoke(doProofreading,6)
> 0.101:debug:29870:36165630: << pyuno::Adapter::invoke()
> 0.741:debug:29870:36165479: >> LngSvcMgr::UpdateAll()
> 0.742:debug:29870:36165479:    LngSvcMgr::UpdateAll() 697 'com.sun.star.linguistic2.SpellChecker' nNodeNames=140
> 0.820:debug:29870:36165479: >> MacSpellChecker::getLocales()
> 0.840:debug:29870:36165479:    MacSpellChecker::getLocales(): count=22
> 0.840:debug:29870:36165479: << MacSpellChecker::getLocales()
> 0.889:debug:29870:36165479: >> MacSpellChecker::getLocales()
> 0.889:debug:29870:36165479: << MacSpellChecker::getLocales()
> 0.889:debug:29870:36165479:    LngSvcMgr::UpdateAll() 717 nAvailLocales=140
> 0.936:debug:29870:36165479:    LngSvcMgr::UpdateAll() 697 'com.sun.star.linguistic2.Proofreader' nNodeNames=19
> 0.937:debug:29870:36165479: >> LngSvcMgr::GetAvailableGrammarSvcs_Impl()
> 0.937:debug:29870:36165479: >> pyuno::Adapter::invoke(activate,4)
> 0.940:debug:29870:36165479: Lightproof.py HEAD
> 0.940:debug:29870:36165479: = 2
> 0.940:debug:29870:36165479: = 3
> 1.598:debug:29870:36165479: = 4
> 1.598:debug:29870:36165479: = 5
> 1.599:debug:29870:36165479: = 6
> 1.599:debug:29870:36165479: = 7
> 1.601:debug:29870:36165479: = 8
> 1.602:debug:29870:36165479: << pyuno::Adapter::invoke()


The Lightproof.py line and the following lines "== 2" etc are from
instdir/LibreOffice.app/Contents/Resources/extensions/dict-pt-BR/Lightproof.py,
where I added some pyuno.sal_debug() calls (an upcoming enhancement, soon in
gerrit):

> # Lightproof grammar checker for LibreOffice and OpenOffice.org
> # 2009-2012 (c) Laszlo Nemeth (nemeth at numbertext org), license: MPL 1.1 / GPLv3+ / LGPLv3+
> 
> import pyuno
> pyuno.sal_debug('Lightproof.py HEAD')
> pyuno.sal_debug('= 2')
> import uno, unohelper, os, sys, traceback
> pyuno.sal_debug('= 3')
> from lightproof_impl_pt_BR import locales
> pyuno.sal_debug('= 4')
> from lightproof_impl_pt_BR import pkg
> pyuno.sal_debug('= 5')
> import lightproof_impl_pt_BR
> pyuno.sal_debug('= 6')
> import lightproof_handler_pt_BR
> pyuno.sal_debug('= 7')
> 

I.e. it is clear that the thing that takes lots of time is loading the
lightproof_impl_pt_BR Python module. Even if what is done at this stage is just
getting a list of locales that we have proofreaders for. The
lightproof_impl_pt_BR module is *huge* (it has the actual data for pt-BR for
Lightproof). And note that there isn't even any document with text in pt-BR
open in LibreOffice... So it is totally unnecessary to waste CPU time on
loading that data. The Lightproof code needs to be reorganised so that the
heavy data modules are loaded only when actually needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180620/19616228/attachment.html>


More information about the Libreoffice-bugs mailing list