Bug 131468 - Calc slow when handling colour emoji (Linux-only)
Summary: Calc slow when handling colour emoji (Linux-only)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace, perf
Depends on:
Blocks:
 
Reported: 2020-03-21 17:07 UTC by lightonflux
Modified: 2022-02-04 15:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
calc doc with 250 emojis (12.00 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-03-21 17:07 UTC, lightonflux
Details
image how it looks rendered (7.27 KB, image/png)
2020-03-22 17:05 UTC, lightonflux
Details
screenshot of sysprof (115.58 KB, image/png)
2020-05-28 17:23 UTC, lightonflux
Details
sysprof recording (2.04 MB, application/x-sysprof-capture)
2020-05-28 17:24 UTC, lightonflux
Details
Perf flamegraph (63.52 KB, image/svg+xml)
2020-06-15 18:38 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lightonflux 2020-03-21 17:07:56 UTC
Created attachment 158854 [details]
calc doc with 250 emojis

Version information:
Version: 6.4.2.2
Build-ID: 4e471d8c02c9c90f512f7f9ead8875b57fcb1ec3
CPU-Threads: 4; BS: Linux 5.5; UI-Render: Standard; VCL: gtk3; 
Flatpak
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded
---------


When using colour emojis, which can easily happen when you copy e.g. a task list from a website writer becomes really slow. 

I attached an example file with about 150 ✅ symbols so it is very easy to reproduce.
Comment 1 m_a_riosv 2020-03-22 12:20:56 UTC
I can't see any slowness on windows:
Version: 6.4.2.2 (x64)
Build ID: 4e471d8c02c9c90f512f7f9ead8875b57fcb1ec3
CPU threads: 4; OS: Windows 10.0 Build 19587; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US Calc: CL
Comment 2 lightonflux 2020-03-22 17:05:30 UTC
Created attachment 158879 [details]
image how it looks rendered

Attached a picture. Because if you don't have a font that supports colour emojis (like google-noto-emoji-color-fonts) it might be rendered in black, thus not being as slow.
Comment 3 Stanislaus J. Pinasthika 2020-05-25 22:55:19 UTC
Thanks for reporting the issue. I opened your .ods files attachment. The emoji is rendered in green but not show any slowness

Version: 6.4.2.2
Build ID: 1:6.4.2-0ubuntu3
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: kf5; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Version: 7.0.0.0.alpha1+
Build ID: 0677d46bcc56c1f6c27b9331662990b38fd452d6
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: kf5; 
Locale: en-US (en_US.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-05-21_12:54:11
Calc: CL

I tried to copy the all of emojies and ran less than 1s
Comment 4 lightonflux 2020-05-28 17:22:13 UTC
I did some further testing and ran sysprof. While scrolling the CPU usage hits 100% on one core.
When looking at the recorded time frame in syslog i see 12k hits for libfontconfig.so.1.12.0. Which is 87% of all (recorded) function calls in the 5 sec time frame. 

See screenshot 5sec-scrolling-sysprof.png. I also attached the complete recording.
Comment 5 lightonflux 2020-05-28 17:23:02 UTC
Created attachment 161380 [details]
screenshot of sysprof
Comment 6 lightonflux 2020-05-28 17:24:39 UTC
Created attachment 161381 [details]
sysprof recording
Comment 7 Buovjaga 2020-06-15 18:36:38 UTC
Installed noto-fonts-emoji package on Arch and confirm the slowness. It is seen in master of Linux 6.3 bibisect repo, but in some older commits (1000 commits backwards from master, oldest), the color emoji font is not recognised and can not be chosen.
Comment 8 Buovjaga 2020-06-15 18:38:34 UTC
Created attachment 162019 [details]
Perf flamegraph

Recorded scrolling a bit.

Arch Linux 64-bit
Version: 7.1.0.0.alpha0+
Build ID: 43bdac0ebd65dfc32a0b8cf2c42fde88ad585e3f
CPU threads: 8; OS: Linux 5.7; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 15 June 2020
Comment 9 Buovjaga 2022-02-02 15:30:40 UTC
I can't reproduce anymore even with older versions. Maybe it was something unrelated to LibreOffice. I also noticed the reporter of bug 145301 said the issue was gone.
Comment 10 lightonflux 2022-02-04 15:09:52 UTC
I retested the issue with this version.

Version: 7.2.5.2 / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Flatpak
Calc: threaded

I cannot reproduce it any more. The LO version is update and the OS is too.

Thanks for checking in with the bug and all your help!