Bug 155260 - Lots of CPU time spent in SwFieldType::GetXObject while spell-checking
Summary: Lots of CPU time spent in SwFieldType::GetXObject while spell-checking
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks:
 
Reported: 2023-05-12 10:42 UTC by Telesto
Modified: 2023-05-17 14:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2023-05-12 10:42:50 UTC
Description:
Lots of CPU time spend in SwFieldType::GetXObject while spell-checking

Steps to Reproduce:
1. Have a Swedish dictionary installed and automatic spell checking disabled 
2. Open attachment 155192 [details]. 90 seconds until on screen (OK)
3. Wait until  CPU drops to 0% 
4. Enable spell automatic spell checking.. I waited 300 seconds, but it didn't finish. Memory usage keeps incrementing in small steps too

SwFieldType::GetXObject	swlo
linguistic_DicList_get_implementation	mergedlo
linguistic_DicList_get_implementation	mergedlo
osl_getTempDirURL	sal3

Nearly all the time is spend in SwFieldType::GetXObject	

Actual Results:
Idle process keeps going.. 

Expected Results:
I'm lacking a decent benchmark. 4.4.7.2 has different idle timers. LibreOffice 5.2 is spending lots of time layouting tables 

So random guess would be 180 seconds


Reproducible: Always


User Profile Reset: No

Additional Info:
Found in
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 99a88c9e55872214ce01d89447d18708e47e956b
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded

and in
Version: 5.2.5.0.0+
Build ID: a4d4fbeb623013f6377b30711ceedb38ea4b49f8
CPU Threads: 4; OS Version: Windows 6.2; UI Render: GL; 
TinderBox: Win-x86@62-merge-TDF, Branch:libreoffice-5-2, Time: 2016-12-24_14:43:55
Locale: nl-NL (nl_NL); Calc: CL

Note the trace for 5.2.5 is different. Time isn't spend in SwFieldType::GetXObject	as such more in SwFrame::ImplFindTabFrame
Comment 1 m_a_riosv 2023-05-12 16:09:21 UTC
For me, it opens in a few seconds. No time to wait after enable 'Automatic spell checker'.
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 99a88c9e55872214ce01d89447d18708e47e956b
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
Comment 2 Telesto 2023-05-12 22:52:07 UTC
(In reply to m.a.riosv from comment #1)
> For me, it opens in a few seconds. No time to wait after enable 'Automatic
> spell checker'.
> Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
> Build ID: 99a88c9e55872214ce01d89447d18708e47e956b
> CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
> Locale: es-ES (es_ES); UI: en-US Calc: CL threaded

There is no delay when toggling automatic spell checker on or freeze, however LibreOffice keeps utilizing a single core in the task manager at max.
Comment 3 m_a_riosv 2023-05-13 08:12:44 UTC
Are you sure attached file it's the right one?
Comment 4 Telesto 2023-05-13 11:50:30 UTC
(In reply to m.a.riosv from comment #3)
> Are you sure attached file it's the right one?

You're right: wrong file. It should have been: attachment 187146 [details] (bug 155192)
Comment 5 m_a_riosv 2023-05-13 23:37:59 UTC
With my last test, doesn't happen.
But I don't know if this sample file, it's a good sample.
Everything, it's incorrect xxxxxxx.
BTW saving the file with LO reduce their size to 1800, and cleaning the direct format in the body text to 1300.
Comment 6 Buovjaga 2023-05-17 14:00:04 UTC
Not reproduced with attachment 187146 [details] and Swedish spell checking. Only does a few seconds of CPU spike.

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 22950a9b008e1bb22fa9e54b5d45715e25fee764
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: en-US (en_FI); UI: en-US
Calc: threaded