<div dir="ltr"><div>What's with fon files being slow? Please report *that* and let's fix it.<br><br></div>We've made scanning, like, 100x faster already. 2007 stats are irrelevant. Checksuming files is slower than scanning them now.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 25, 2018 at 8:08 AM, Kurt Kartaltepe <span dir="ltr"><<a href="mailto:kkartaltepe@gmail.com" target="_blank">kkartaltepe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While trying to move a project to the pango stack I noticed the native<br>
font selection backends were bad/useless on some platforms (like<br>
windows see [1]). So I opted to try and use fontconfig on all<br>
platforms as it performs outstandingly and has wonderful defaults for<br>
all platforms.<br>
<br>
However during this transition I noticed that there are some major<br>
issues with cache build speed and during investigation I see that<br>
there has recently been effort to improve the situation[2]. From what<br>
I can tell the fontconfig team has maintained that these cache issues<br>
were irrelevent for the primary fontconfig platform (linux) [3]. On<br>
linux of course the cache is global and maintained usually by font<br>
packages ensuring its up-to-date. However it was precisely this the<br>
slow cache build times that lead to package managers being required to<br>
build in additional tooling to support not rebuilding cache for every<br>
font installed [4].<br>
<br>
Anyway I hope that is enough reason to persuade you that there are<br>
substantial improvements to make to the caching strategy and they are<br>
beneficial not only for the odd platforms (osx, windows) but also for<br>
Linux.<br>
<br>
My question is if fontconfig would be receptive to building/accepting<br>
a patch modifying the caching strategy to include checkums per file<br>
instead of/in addition to per directory. Currently any change to<br>
directory (such as adding a new font) invalidates all fonts within<br>
that directory. This means for directories like the system directory<br>
it results in re scans of hundreds or more fonts. Thankfully this is<br>
faster on platforms like linux where all fonts on freetype. However<br>
this improvement in scanning did not carry over to windows with its<br>
many FNT (150 on the average install) and even on my very robust<br>
development machine building a cache for a mere 650 files takes half a<br>
minute. This might be acceptable on install of the application where<br>
we can take our time building the cache, but what happens when a user<br>
installs 1 more font? A change to cache individual file checksums<br>
would provide fontconfig a way to only require the expensive coverage<br>
check of a single font instead of the entirety of a users. I dare say<br>
with this exact change the need to use a faster less robust coverage<br>
check that made scanning freetype fonts faster may be unneeded as the<br>
number of scans required to rebuild a cache would reduced 100x on the<br>
average system or more.<br>
<br>
I'm certain such a change would be highly appreciated by all<br>
fontconfig consumers who are hoping to use its powerful feature set in<br>
a multiplatform context.<br>
<br>
--Kurt Kartaltepe<br>
<br>
[1] <a href="https://bugzilla.gnome.org/show_bug.cgi?id=162681" rel="noreferrer" target="_blank">https://bugzilla.gnome.org/<wbr>show_bug.cgi?id=162681</a><br>
[2] <a href="https://lists.freedesktop.org/archives/fontconfig/2017-August/005986.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/fontconfig/2017-<wbr>August/005986.html</a><br>
[3] <a href="https://bugs.freedesktop.org/show_bug.cgi?id=64766" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=64766</a><br>
[4] <a href="https://lists.freedesktop.org/archives/fontconfig/2007-October/002728.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/fontconfig/2007-<wbr>October/002728.html</a><br>
______________________________<wbr>_________________<br>
Fontconfig mailing list<br>
<a href="mailto:Fontconfig@lists.freedesktop.org">Fontconfig@lists.freedesktop.<wbr>org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/fontconfig" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/fontconfig</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">behdad<br><a href="http://behdad.org/" target="_blank">http://behdad.org/</a></div>
</div>