Deprecate FC_HASH and don't compute it

It was added without proper measurement and a fuzzy possible
use-case (font servers) in mind, but reality check shows that
this significantly slows down caching.  As such, deprecate it
and do NOT compute hash during caching.

Makes caching two to three times faster (ignoring the 2 second
delay in fc-cache).
This commit is contained in:
Behdad Esfahbod 2014-06-09 21:53:01 -04:00
parent cd9631d83e
commit 75abdaf5c8
4 changed files with 6 additions and 4 deletions

View File

@ -198,7 +198,7 @@ convenience for the application's rendering mechanism.
stylelang and fullnamelang
prgname FC_PRGNAME String Name of the running program
hash FC_HASH String SHA256 hash value of the font data
with "sha256:" prefix.
with "sha256:" prefix (deprecated)
postscriptname FC_POSTSCRIPT_NAME String Font name in PostScript
</programlisting>
</sect2>

View File

@ -115,7 +115,7 @@ typedef int FcBool;
#define FC_FONT_FEATURES "fontfeatures" /* String */
#define FC_NAMELANG "namelang" /* String RFC 3866 langs */
#define FC_PRGNAME "prgname" /* String */
#define FC_HASH "hash" /* String */
#define FC_HASH "hash" /* String (deprecated) */
#define FC_POSTSCRIPT_NAME "postscriptname" /* String */
#define FC_CACHE_SUFFIX ".cache-" FC_CACHE_VERSION

View File

@ -1697,6 +1697,7 @@ FcFreeTypeQueryFace (const FT_Face face,
goto bail1;
#if 0
/*
* Compute hash digest for the font
*/
@ -1744,6 +1745,7 @@ FcFreeTypeQueryFace (const FT_Face face,
free (hashstr);
}
}
#endif
/*

View File

@ -44,7 +44,7 @@ FC_OBJECT (AUTOHINT, FcTypeBool, NULL)
FC_OBJECT (GLOBAL_ADVANCE, FcTypeBool, NULL) /* deprecated */
FC_OBJECT (FILE, FcTypeString, FcCompareFilename)
FC_OBJECT (INDEX, FcTypeInteger, NULL)
FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString)
FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString) /* deprecated */
FC_OBJECT (OUTLINE, FcTypeBool, FcCompareBool)
FC_OBJECT (SCALABLE, FcTypeBool, FcCompareBool)
FC_OBJECT (DPI, FcTypeDouble, NULL)
@ -66,6 +66,6 @@ FC_OBJECT (LCD_FILTER, FcTypeInteger, NULL)
FC_OBJECT (NAMELANG, FcTypeString, NULL)
FC_OBJECT (FONT_FEATURES, FcTypeString, NULL)
FC_OBJECT (PRGNAME, FcTypeString, NULL)
FC_OBJECT (HASH, FcTypeString, FcCompareHash)
FC_OBJECT (HASH, FcTypeString, FcCompareHash) /* deprecated */
FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
/* ^-------------- Add new objects here. */