#997071 mate-font-viewer: Shows empty content for very long time

Package:
mate-control-center
Source:
mate-control-center
Description:
utilities to configure the MATE desktop
Submitter:
Witold Baryluk
Date:
2021-10-23 14:21:04 UTC
Severity:
normal
#997071#5
Date:
2021-10-23 14:19:09 UTC
From:
To:
Initially I was thinking mate font viewer is completly broken. Launching
it on my desktop will show empty content, with just menu bar, and "All
Fonts", but no fonts would show up at all. No messages when running in a
terminal.

However, it looks it is just extremally slow. Launching it and leaving
for about 30 seconds, some fonts starts showing up, but then it takes
another 2-3 minutes until the preview of even the first 12 fonts loads
(the ones initially on screen).

Possible improvements:

1) When loading font list itself, show the spinner, with progress indicator.
I do not know why mate font viewer takes so long, as initial list can be retrived
from fontconfig in about 40ms on my computer.

2) When loading font previews, be faster.

3) Load multiple font previews in parallal (I have 16 cores, 32 cores,
and extremally fast IO 4GB/s+, doh).

4) When loading font previews, priotize the ones that are in the current view of
the scroll area. Right now font preview loads them almost randomly.

5) Cache previews on disk (i.e. as PNG file), so the future loads are
faster. The cache can be validated asynchronously against the
modification time of the font, or the hash of its content. Right now
starting font viewer, it needs to go through whole slow ordeal again. (It
is faster on second run, possibly due to the kernel file cache being
warmed up, but still slow. Not 1 minute, but still too slow for what it
is supposed to do).

PS.

$ time fc-list | wc -l
3596

real	0m0.042s
user	0m0.043s
sys	0m0.000s
$