[Fontconfig-bugs] [Bug 64766] Make fontconfig scanning faster

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 22 18:14:15 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=64766

--- Comment #6 from Behdad Esfahbod <freedesktop at behdad.org> ---
(In reply to comment #5)
> > That is required to let fontconfig know what the glyph coverage a font has.
> 
> Somehow freetype seems to spend rather a lot of effort on that. I don't know
> how this stuff works, but to my naive eyes is looks like there's further
> optimization possible, though possibly that would require changes in
> freetype instead of fontconfig.

I may take a look.  We load all glyphs just to make sure the font actually has
it, as opposed to having bogus or empty glyphs.  Maybe that level of paranoia
is not quite needed these days...


> >> When a directory changes, we rescan the entire directory to rebuild the
> >> cache for that dir.
> 
> > I have no idea how this can be improved though.
> 
> For example, the granularity of the cache could be changed and create a new
> cache for every 20 files or so.

Each cache file would mean one more mmap() in every fontconfig-using client. 
That's already bad enough...

> Or it could be made such that the old cache
> is reused for files that have not changed. No doubt, these changes would be
> intrusive to the cache code, but given the problems with font scanning
> times, I think it would be worth it.
>
> Now that you have added a hash for each font, maybe it would be possible to
> cache the results for memory fonts as well? Hashing actually makes loading a
> font even slower, but since you're doing it anyway, maybe it could be used
> for that purpose as well.

Yeah, maybe we can have a cache of individual fonts based on hashes.  Then we
can rebuild directory caches based on those individual fonts much faster.

For memory fonts, is it really a big deal?  Why do people query those anyway?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20130523/8029ad3e/attachment.html>


More information about the Fontconfig-bugs mailing list