[Fontconfig] Application startup performance

Keith Packard keithp at keithp.com
Fri Jan 15 15:34:55 PST 2016

Behdad Esfahbod <behdad.esfahbod at gmail.com> writes:

> I think what Akira is saying is that it's not enough to check the mtime of the
> toplevel directory.

No argument there; it should be checking the mtime of every directory in
the hierarchy.

> My understanding of the thread is that, to fix it, Akira added a readdir() at
> the end; whereas what you are saying (which I agree with), is that instead of
> the readdir(), we should just traverse the subdirectories using the subdir
> list in the cache files, and check the mtime of all the subdirs.

Right, that should be sufficient, and I thought that was how the code worked.

> All these said, since, I don't think there exists an atomic "check mtime &
> rename" syscall available, *any* solution will be racy.  It's just about being
> easy to hit or not.

Completely agreed; it's all about making the window small and making the
consequences minor. In this case, the consequence should only be that
the cache file is out of date, and that a future application will
discover that at startup and also try to fix it. Eventually, some
application should manage to construct an accurate cache once font
installation is done...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20160115/199e858f/attachment.sig>

More information about the Fontconfig mailing list