CL 8895017: [fonts] Cache Android system font fallback lookups [chromium/src : main]

0 views
Skip to first unread message

Tudor Cretu (Gerrit)

unread,
12:09 PM (2 hours ago) 12:09 PM
to Stephen Chenney, chromium...@chromium.org, Dirk Schulze, kinuko...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, blink-reviews-p...@chromium.org

Tudor Cretu has uploaded change 8895017 for review

Commit message

[fonts] Cache Android system font fallback lookups

On Android, HarfBuzzShaper creates a fresh FontFallbackIterator per text
run, causing Blink to re-run Skia MatchFamilyStyleCharacter on every run
in non-Latin and emoji text. In Android Stable UMA, non-Latin
navigations average 1.92 ms in Renderer.Font.SystemFallback.FCP (up to
3.68 ms mean and 54.0 ms p99 in Arabic-heavy locales), with over 80%
repeat fallback lookups per navigation and 65% of slow fallback samples
scanning font cmap tables inside SkFontMgr_Android.

Add a bounded 256-entry per-thread Android character fallback cache
behind the default-off AndroidCharacterFallbackCache feature, cleared on
both FontCache::ReleaseMemory() and FontCache::Invalidate().
Single-primary-family BMP non-Latin scripts share an exemplar-seeded
slot verified via unicharToGlyph(), while Plane 1+ characters, emoji,
explicit non-Nastaliq und-<Script> requests, and shared scripts (such as
USCRIPT_COMMON) key by exact codepoint and preserve async GMSCore emoji
upgrades.

Verified blink_platform_unittests (*FontCache*:*FontFallback*) pass on
Android 15 (dcheck_always_on = true) with default flags and with
--enable-features=AndroidCharacterFallbackCache --gtest_shuffle (32/33
passed, 1 Nastaliq font skip). Local Pixel 11 Pro XL 50-iteration
LoadLine 2 A/B (Official ARM64 PGO+ThinLTO+orderfile) is neutral
(-0.045% across 44 thermal-matched pairs, 0 errors), matching Latin-heavy
benchmark coverage.
Bug: 594017853
Test: blink_platform_unittests --gtest_filter="*FontCache*:*FontFallback*"
Change-Id: Ia5a906d74cfbd3b15117e4e9389a312815cf968a

Change diff


Change information

Files:
  • M third_party/blink/common/features.cc
  • M third_party/blink/public/common/features.h
  • M third_party/blink/renderer/platform/fonts/android/font_cache_android.cc
  • M third_party/blink/renderer/platform/fonts/android/font_cache_android_test.cc
  • M third_party/blink/renderer/platform/fonts/font_cache.cc
  • M third_party/blink/renderer/platform/fonts/font_cache.h
  • M third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
Change size: L
Delta: 7 files changed, 804 insertions(+), 24 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5a906d74cfbd3b15117e4e9389a312815cf968a
Gerrit-Change-Number: 8895017
Gerrit-PatchSet: 1
Gerrit-Owner: Tudor Cretu <tudor...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages