Re: icon theme weight query ... (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Behdad Esfahbod wrote:
> Hi,
> 
> Michael Meeks points a very inefficient read loop in fontconfig.
> Should be easy to fix...  Would have been easier in fact if
> fontconfig was mmapping the cache file right away...

Yes, fontconfig reads the header of the cache file one byte at a time.
The header tells fontconfig whether the cache file is global or not (so
that's one string) and about the sizes of things on that architecture
(another string).  There should be about 160 bytes this way, but since
it's a string, it's kind of hard to tell how many bytes there should be.
 The old fontconfig used getc, but that was less bad since it was on a
FILE *.

Hopefully Dirk will have a patch soon.  It should only need to change
FcCacheReadString.  There's a convenient 'len' parameter to
FcCacheReadString which would be useful in deciding how much to read, so
it should be something like this:

read (fd, dest, len);
// iterate though and replace \\ with \, etc
lseek (fd, strlen(dest)-len, SEEK_SET);

pat
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux