Bug 159232

Summary: LibreOffice loads the single variable TTC font (which named Sarasa Gothic) very slowly
Product: LibreOffice Reporter: Sigmund <qwe2968>
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: ilmari.lauhakangas, qwe2968
Priority: medium Keywords: bibisectRequest, perf, regression
Version: 6.1.0.3 release   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Strace log when use SuperTTC
Strace log when use separate font TTC

Description Sigmund 2024-01-17 02:06:26 UTC
Description:
When LibreOffice start, it needs to read and load the font files. And I tested the font named Sarasa Gothic[https://github.com/be5invis/Sarasa-Gothic/releases/tag/v1.0.3]. In its release pages, there are two kinds of font packages. "Sarasa-SuperTTC-1.0.3.7z" is the single variable TTC font package, and "Sarasa-TTC-1.0.3.7z" is the package which contains the normal separate fonts.

After testing with strace, LibreOffice takes more time (about 2 minutes) to load the font Sarasa-SuperTTC.ttc. However, LibreOffice takes about 15 seconds to load all the separate fonts in package "Sarasa-TTC-1.0.3.7z".

Thus I guessed that LibreOffice might have bugs when it comes to handling single large variable font. And I also created a issue at [https://gitlab.archlinux.org/archlinux/packaging/packages/ttf-sarasa-gothic/-/issues/1].

Steps to Reproduce:
1. Use the superTTC font package [https://github.com/be5invis/Sarasa-Gothic/releases/download/v1.0.3/Sarasa-SuperTTC-1.0.3.7z].
2. Install the font, and use strace to debug LibreOffice.
3. Search the debug log, it shows that it took from 8:50 to 8:52 to load Sarasa-SuperTTC.ttc

Actual Results:
Single large variable font file loads very slowly even though the fonts in two font packages are identical.

Expected Results:
LibreOffice can handle the single variable font files quickly.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 8; OS: Linux 6.7; UI render: default; VCL: kf5 (cairo+xcb)
Locale: zh-CN (en_US.UTF-8); UI: zh-CN
7.6.4-2
Calc: threaded
Comment 1 Sigmund 2024-01-17 02:07:24 UTC
Created attachment 192007 [details]
Strace log when use SuperTTC
Comment 2 Sigmund 2024-01-17 02:07:56 UTC
Created attachment 192008 [details]
Strace log when use separate font TTC
Comment 3 Buovjaga 2024-01-29 13:30:21 UTC
Confirmed by Toolybird in Arch Gitlab.
Comment 4 Buovjaga 2024-01-29 14:03:14 UTC
I see the slowness in oldest of linux-64-6.1 bibisect repo, but not in oldest of 5.4. Unfortunately, between these I can't run the binaries on my normal system and distrobox does not load the Sarasa fonts, so I can't bibisect.