Bug 123860

Summary: High CPU usage and lag when scrolling past Noto Sans in the font list
Product: LibreOffice Reporter: kmvan <kmvan.com>
Component: UIAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTOURBUG    
Severity: normal CC: buzea.bogdan, ilmari.lauhakangas, telesto, xiscofauli
Priority: medium Keywords: haveBacktrace, perf
Version: 6.2.0.3 release   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 136524, 146014    
Attachments: Perf flamegraph

Description kmvan 2019-03-05 07:37:29 UTC
Description:
Lag to scroll fonts list after many fonts (100+) installed. Maybe the `font-preview` causes it.

Steps to Reproduce:
1. Install many fonts (like Noto sans fonts...)
2. Open Writer and scroll font list to Noto Sans area.

Actual Results:
CPU usage high and UI lag.

Expected Results:
Normally CPU usage.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Xisco FaulĂ­ 2019-04-16 09:05:39 UTC
Could you please paste the info from Help - about LibreOffice ?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once the information has been provided
Comment 2 kmvan 2019-04-16 09:13:01 UTC
(In reply to Xisco FaulĂ­ from comment #1)
> Could you please paste the info from Help - about LibreOffice ?
> 
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' once the information has been provided

Sure.

Version: 6.2.2.2
Build ID: 6.2.2-2
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.utf8); UI-Language: en-US
Calc: threaded
Comment 3 Buovjaga 2019-08-14 16:30:00 UTC
Created attachment 153392 [details]
Perf flamegraph

It's true, Noto Sans chokes it somewhat. The lag/CPU hit is not as bad with kf5 backend.

Arch Linux 64-bit
Version: 6.4.0.0.alpha0+
Build ID: b9a776837462eeb6d50d0decc42604c0c3008eb1
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 11 August 2019
Comment 4 Buovjaga 2022-04-20 08:51:24 UTC
fontconfig version 2.14 released on 2022-03-31 includes a huge performance boost related to this problem. The relevant code change is https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/8022ab4aff469a8f095ce3168d879d3e0b3605ef

I have Arch Linux and they shipped the 2.14 version and the problem is now gone with gtk3 LibreOffice.