[Fontconfig] Application startup performance

Nick Alcock nick.alcock at oracle.com
Mon Jan 11 03:59:26 PST 2016

On 9 Jan 2016, Keith Packard spake thusly:

> Patrick Haller <patrick.haller at haller-consult.de> writes:
>> - assuming that readdir() will never return duplicate filenames within 
>> the very same directory.
> If readdir is getting called at each application startup, there's a
> problem with the caching mechanisms in fontconfig that should get fixed.

Oh, readdir() is nothing. At the moment, *stat()* is getting called for
every font file in that path, because it wants to get the file times to
see if the cache needs to be updated. (This is despite the fact that
most of the fonts are systemwide and the cache for them is always up to
date due to the distro scripts running fc-cache as needed.)

>>                          Unoptimized     Optimized
>> user[s]                         0,806         0,579
> This will be a nice improvement, even when the caching bugs are fixed,
> for times when the cache does need to get regenerated.

I'd be quite happy if it just updated the cache only for directories
under ~ or directories the user had permission to write to.

NULL && (void)

More information about the Fontconfig mailing list