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

Issue 2215543002: Remove unnecessary font loading when loading font fallbacks. (Closed)

Created:
4 years, 4 months ago by Ilya Kulshin
Modified:
4 years, 4 months ago
Reviewers:
drott, kojii, eae
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, brucedawson, Bret, Rik, chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, eae, f(malita), jam, jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney, stanisc
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove unnecessary font loading when loading font fallbacks. Previously, we were going through all possible fallback fonts and testing each for existence as soon as something asked for any fallback font. Due to how isFontPresent is implemented, it actually loads the font. This change defers testing font existence (and loading them) until a font for that script is actually needed. I expect this will result in a perf gain, since I expect most pages will need only a few fallback fonts. In my very limited and not very rigorous testing, I observed about a 5% improvement in warm startup (Startup.FirstWebContents.NonEmptyPaint2) when navigating to emojipedia.org. BUG=631258 Committed: https://crrev.com/3f489f6b953f464a1a0b5996bc79e468ba9e35e1 Cr-Commit-Position: refs/heads/master@{#410729}

Patch Set 1 #

Patch Set 2 : Remove extra file #

Patch Set 3 : Remove the separate latin/greek/cyrillic font map and add those fonts to the main map #

Total comments: 6

Patch Set 4 : Refactor based on codereview feedback #

Total comments: 2

Patch Set 5 : Remove scriptMonospaceFontMap #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -44 lines) Patch
M third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp View 1 2 3 4 10 chunks +45 lines, -44 lines 0 comments Download

Messages

Total messages: 35 (24 generated)
Ilya Kulshin
ptal, especially the Han fallback logic, since you've been working recently in that area.
4 years, 4 months ago (2016-08-04 01:46:53 UTC) #2
kojii
Thank you for working on this. I was a little concerned about this too, but ...
4 years, 4 months ago (2016-08-04 06:01:53 UTC) #9
kojii
https://codereview.chromium.org/2215543002/diff/40001/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp File third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp (right): https://codereview.chromium.org/2215543002/diff/40001/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp#newcode73 third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp:73: bool attemptedLoad; How about adding: const UChar** candidateFamilyNames; so ...
4 years, 4 months ago (2016-08-04 06:02:03 UTC) #10
Ilya Kulshin
ptal. I refactored the code as you suggested, so that now it will loop once ...
4 years, 4 months ago (2016-08-06 03:20:50 UTC) #13
kojii
Non-owner lgtm with nit. drott/eae, PTAL. > I ran a few more tests and confirmed ...
4 years, 4 months ago (2016-08-06 09:33:13 UTC) #19
eae
LGTM once you've addressed kojiis comment.
4 years, 4 months ago (2016-08-08 12:59:54 UTC) #20
Ilya Kulshin
https://codereview.chromium.org/2215543002/diff/60001/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp File third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp (right): https://codereview.chromium.org/2215543002/diff/60001/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp#newcode447 third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp:447: if (!scriptMonospaceFontMap[script].familyName) { On 2016/08/06 09:33:13, kojii wrote: > ...
4 years, 4 months ago (2016-08-08 19:58:29 UTC) #22
kojii
lgtm
4 years, 4 months ago (2016-08-09 06:35:48 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2215543002/100001
4 years, 4 months ago (2016-08-09 17:33:15 UTC) #32
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 4 months ago (2016-08-09 17:38:47 UTC) #33
commit-bot: I haz the power
4 years, 4 months ago (2016-08-09 17:41:12 UTC) #35
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/3f489f6b953f464a1a0b5996bc79e468ba9e35e1
Cr-Commit-Position: refs/heads/master@{#410729}

Powered by Google App Engine
This is Rietveld 408576698