<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Make fontconfig scanning faster"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=64766#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Make fontconfig scanning faster"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=64766">bug 64766</a>
              from <span class="vcard"><a class="email" href="mailto:freedesktop@behdad.org" title="Behdad Esfahbod <freedesktop@behdad.org>"> <span class="fn">Behdad Esfahbod</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=64766#c5">comment #5</a>)
<span class="quote">> > 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.</span >

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...


<span class="quote">> >> 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.</span >

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

<span class="quote">> 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.</span >
>
<span class="quote">> 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.</span >

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?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>