Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Issue 1919183002: Store null font lookup result into font cache (Closed)

Created:
4 years, 8 months ago by tzik
Modified:
4 years, 7 months ago
CC:
reviews_skia.org, kinuko
Base URL:
https://chromium.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Store null font lookup result into font cache Font name lookup issues an expensive synchronous IPC on layout calculation. The result of the IPC is usually cached in the renderer, but a null result was not cached. That causes repeated font name query for the same font name. This CL adds the null result into the cache, so that the query happens only once. This reduces the layout time of http://b.hatena.ne.jp from 309ms to 178ms, and reduces its time to first paint from 690ms to 477ms on Linux. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1919183002

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -10 lines) Patch
M src/ports/SkFontHost_fontconfig.cpp View 5 chunks +18 lines, -10 lines 0 comments Download

Messages

Total messages: 21 (7 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1919183002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1919183002/1
4 years, 8 months ago (2016-04-26 13:41:19 UTC) #6
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
4 years, 8 months ago (2016-04-26 13:41:20 UTC) #7
tzik
Kouhei-san: Could you PTAL to this before I send this to skia reviewer?
4 years, 8 months ago (2016-04-26 13:44:49 UTC) #8
commit-bot: I haz the power
Dry run: No LGTM from a valid reviewer yet. Please ask for an LGTM from ...
4 years, 8 months ago (2016-04-26 19:41:01 UTC) #10
kouhei (in TOK)
+eae,bungeman,reed o_O. The number is super impressive.
4 years, 8 months ago (2016-04-26 23:51:37 UTC) #12
eae
Very exciting!
4 years, 8 months ago (2016-04-26 23:55:00 UTC) #13
kouhei (in TOK)
If this look promising, we want to measure the real-world impact of the CL via ...
4 years, 8 months ago (2016-04-27 05:16:48 UTC) #14
bungeman-skia
On 2016/04/26 23:51:37, kouhei wrote: > +eae,bungeman,reed > > o_O. The number is super impressive. ...
4 years, 7 months ago (2016-04-27 14:29:02 UTC) #15
reed1
+1 Can we assist in improving the client-side cache to catch these?
4 years, 7 months ago (2016-04-27 14:43:34 UTC) #16
tzik
On 2016/04/27 14:29:02, bungeman-skia wrote: > On 2016/04/26 23:51:37, kouhei wrote: > > +eae,bungeman,reed > ...
4 years, 7 months ago (2016-04-28 18:56:13 UTC) #17
bungeman-skia
On 2016/04/28 18:56:13, tzik wrote: > On 2016/04/27 14:29:02, bungeman-skia wrote: > > On 2016/04/26 ...
4 years, 7 months ago (2016-04-28 21:18:28 UTC) #18
bungeman-skia
Also, apparently this extra font request cache is a drag on general performance in Blink ...
4 years, 7 months ago (2016-04-28 21:40:36 UTC) #19
tzik
On 2016/04/28 21:18:28, bungeman-skia wrote: > On 2016/04/28 18:56:13, tzik wrote: > > On 2016/04/27 ...
4 years, 7 months ago (2016-04-29 02:53:29 UTC) #20
eae
4 years, 7 months ago (2016-04-29 02:54:35 UTC) #21
On 2016/04/29 02:53:29, tzik wrote:
> On 2016/04/28 21:18:28, bungeman-skia wrote:
> > On 2016/04/28 18:56:13, tzik wrote:
> > > On 2016/04/27 14:29:02, bungeman-skia wrote:
> > > > On 2016/04/26 23:51:37, kouhei wrote:
> > > > > +eae,bungeman,reed
> > > > > 
> > > > > o_O. The number is super impressive.
> > > > 
> > > > The numbers are super depressing. The cache here was created as a crutch
> for
> > > gfx
> > > > and we need to move toward no longer needing it, not 'improving' it. If
> this
> > > CL
> > > > is really making a big difference in blink, that means that blink is
> > > repeatedly
> > > > making the same request over and over. I would have thought that this
> would
> > > > already be handled by blink's FontCache. Is there a reason why it isn't?
> > > 
> > > The difference between SkFontHostRequestCache and blink::FontCache is
> > > granularity: blink::FontCache uses the font size as a part of cache key
> while
> > > SkFontHostRequestCache doesn't.
> > > Blink issues the request for each font size, and non-null results are
served
> > > from SkFontHostRequestCache if available, but null results are not.
> > 
> > So Blink (on *nix) makes requests without a size, but then caches with a
size?
> 
> Yes on Linux and Windows:
> FontCache::createFontPlatformData [1,2] takes |fontSize| and |fontDescription|
> (which has the font size [3]), but the size is not used to create SkTypeface
> [4]. Then it's stored as a blink::FontPlatformData with blink::FontCacheKey,
> which contain the font size [5,6].

Good find, we should probably fix that...

Powered by Google App Engine
This is Rietveld 408576698