Add a cache for FillFontFamilyMap.
The function is called ~20,000 times on a fresh launch of Chrome on my MacBook Pro. Adding a dumb cache to reduce redundant fetches reduced cpu cycles in the function by 75% (profiled by DTrace). The class FontFamilyCache performs the caching, and the observation of the PrefService to ensure that the cache does not become stale. The Profile owns the FontFamilyCache to ensure that the cache does not outlive the PrefService. BUG=308095 Review URL: https://codereview.chromium.org/439913002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287953 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment