DescriptionCache character fallback information in WebFontInfo::fallbackFontForChar
Original patch by Eric Seidel, after a discussion with Behdad.
I rebased it on top of my font fallback fix in r176765, without
which this caching logic would regress (see crbug.com/272006).
Quoting Eric's initial changelog entry:
"The old code used to query FontConfig with the
char and locale for every time Blink needed
a fallback font for a character.
The new code only queries FontConfig once for each
locale, saves the resulting FcFontSet. When we need
to know the correct font for a char, we walk the
fonts in the set asking each if they have a glyph for
that character.
The existing logic had a bunch of code to work around
bugs where FontConfig would return invalid fonts.
To avoid walking invalid fonts for each lookup
we create a Vector of FontCache objects at CachedFontSet
creation time and only walk valid CachedFonts at
lookup time."
For the list of page_cycler.intl_ja_zh sites,
I locally get the following speedups in warm_times results:
(full data attached to the bug):
3.8397612488521577 www.baidu.com 2090.750000ms 544.500000ms
3.447672499174645 www.yahoo.co.jp 2610.750000ms 757.250000ms
3.268197920237687 cn.yahoo.com 7150.000000ms 2187.750000ms
2.5949379270522566 zol.com.cn 6741.000000ms 2597.750000ms
2.2926255669410383 goo.ne.jp 3412.000000ms 1488.250000ms
2.2606811489527194 www.sina.com.cn 10172.500000ms 4499.750000ms
2.218289901154351 www.qq.com 8023.000000ms 3616.750000ms
2.1029045643153528 2ch.net 633.500000ms 301.250000ms
1.9500301628795496 kakaku.com 4848.750000ms 2486.500000ms
1.844571008634944 fc2.com_ja 2510.000000ms 1360.750000ms
1.8037104522113632 www.google.com.hk 2722.250000ms 1509.250000ms
1.79902755267423 jugem.jp 4162.500000ms 2313.750000ms
1.778485665278118 www.taobao.com_index_global.ph 3629.000000ms 2040.500000ms
1.7573505120581434 ruten.com.tw 5319.500000ms 3027.000000ms
1.7528028651510432 dtiblog.com 5628.250000ms 3211.000000ms
1.5707825244286522 udn.com_NEWS_mainpage.shtm 4862.750000ms 3095.750000ms
1.517787031528852 hatena.ne.jp 3189.250000ms 2101.250000ms
1.5078812316715542 www.amazon.co.j 2056.750000ms 1364.000000ms
1.4083924349881796 mixi.jp 1191.500000ms 846.000000ms
BUG=266214
R=behdad,eae,eseidel
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178446
Patch Set 1 #Patch Set 2 : Initial attempt of a performance test #Patch Set 3 : Test case moved to separate CL #Patch Set 4 : Rebaselining missing glyph cases #Patch Set 5 : Removing default substitution of FcFontSort Params #Patch Set 6 : Adding test #Patch Set 7 : Calling substitution again, let's see test failures on the bot now #Patch Set 8 : fallbackFontForChar updated to support empty locale #Patch Set 9 : Unit test removed, TestExpecations untouched #Patch Set 10 : Rebaselined, null locale handling #Patch Set 11 : Moving static local variable into function. #Patch Set 12 : Rebaselines for files with missing glyph (new code doesn't just return Arial if no glyph is found) #
Messages
Total messages: 33 (0 generated)
|