[cairo] 1.1.6 to 1.2.0 performance

David Turner dturner at nds.com
Thu Jul 13 02:17:01 PDT 2006


James Cloos a écrit :
> John> Every time I run dot it opens 940 files in /var/cache/fontconfig
> John> just to resolve "Times-Roman" !
>
> That means that fc-cache found 940 (distinct) directories in its
> search path, cumulative over all runs since /var/cache/fontconfig
> was last cleared out.
>
>   
How on earth can you get 940 *directories* of fonts. Even the font CDs 
I've seen only
use a dozen directories, and they're packed with hundreds if not 
thousands of fonts.

It's be nice if James could send us the output of "fc-cache -r -v" to 
see the real numbers,
at least we wouldn't have to conjecture the problem.

I suspect some really horrible thing, like having "/usr/share" in the 
fontconfig search path,
and that most of the 940 cache files stored in /var/cache/fontconfig are 
essentially empty
because they correspond to directories that don't have any fonts in them.
> Fontconfig also keeps a single cache file in $HOME for any fonts
> not covered by the global per-dir cache files, so if you clean out
> /var/{lib,}/cache/fontconfig it will still work, but instead of
> open(2)ing and mmap(2)ing the cache files it will have to stat(2)
> every dir in the search path, see whether any are newer than the
> cache file, and check out every file in those that are newer to
> cache them.  So you don't win much.
>
>   
but doesn't stat-ing these 940 directories is going to be a *lot* faster 
than memory-mapping the
cache files that would be within them otherwise ?. I'm assuming that not 
all of them are going to
change a lot, so a single cache in $HOME could be a performance winner.
> Moving all of the fonts into a single directory, OTOH, would help --
> at least on a filesystem that hashes directories -- though it makes
> management harder.  
>
> I don't believe any other OS would do better with fonts spread out
> over 900+ directories.  
>
>   
An OS like MacOS X uses a single "font server" process. I'm pretty 
certain it wouldn't have
any problem with 900+ directories. Of course, this introduces a single 
point of failure, some
communication latency and startup slowness (unless caching is used); 
nothing is free :-)

Regards,

- David Turner
- The FreeType Project  (www.freetype.org)

PS: Apologies to the Cairo enthusiasts, this thread has little to do 
with your beloved library.


***********************************************************************************
Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster at nds.com and destroy the original message.
*********************************************************************************** 



More information about the cairo mailing list